Skip to content

Implement consistent lock ordering in ApplicationManager #443

Description

@sfloess

Part of #423: Race condition potential in ApplicationManager concurrent operations

Problem

Multiple methods in ApplicationManager acquire locks in different orders, creating potential for deadlock. When methods acquire per-application locks and the global applications map lock in inconsistent order, two threads can each hold one lock while waiting for the other.

Location

  • platform-core/src/main/java/org/flossware/platform/core/ApplicationManager.java

Tasks

  • Audit all lock acquisition sites in ApplicationManager
  • Define a canonical lock ordering (e.g., global map lock before per-application lock)
  • Refactor all methods to follow the canonical ordering
  • Add comments/javadoc documenting the lock ordering contract

Acceptance Criteria

  • All methods that acquire multiple locks do so in the same documented order
  • No deadlock possible between any two concurrent method calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions