Skip to content

Add backpressure to ListenerExecutor task submission #445

Description

@sfloess

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

Problem

The ListenerExecutor uses unbounded task submission. Under heavy load (e.g., rapid deploy/undeploy cycles), this can exhaust memory or cause listener notifications to queue unboundedly, leading to OOM or extreme latency for listener callbacks.

Location

  • platform-core/src/main/java/org/flossware/platform/core/ApplicationManager.java (ListenerExecutor usage)

Tasks

  • Identify all ListenerExecutor submission points
  • Add a bounded queue or semaphore-based backpressure mechanism
  • Define a rejection policy (caller-runs, discard-oldest, or block)
  • Add monitoring/logging when backpressure is applied
  • Ensure listener notification order is preserved where required

Acceptance Criteria

  • ListenerExecutor cannot accumulate unbounded pending tasks
  • Backpressure policy is documented and configurable
  • No listener notifications are silently dropped without logging

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