Skip to content

Add ReadWriteLock for ApplicationManager bulk operations #444

Description

@sfloess

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

Problem

The shutdown() method (line 970-986) iterates over all applications while other threads may be deploying or undeploying apps concurrently. A simple mutex would serialize all operations unnecessarily, but a ReadWriteLock would allow concurrent deploys/undeploys while giving shutdown exclusive access.

Location

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

Tasks

  • Introduce a ReentrantReadWriteLock for the applications map
  • deploy() and undeploy() acquire the read lock (allows concurrency)
  • shutdown() acquires the write lock (exclusive access during bulk iteration)
  • Ensure lock ordering is consistent with the ordering established in the lock ordering sub-issue

Acceptance Criteria

  • shutdown() has exclusive access to the applications map during iteration
  • Concurrent deploy()/undeploy() calls do not interfere with shutdown
  • Normal deploy/undeploy operations remain concurrent with each other

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions