Skip to content

fix: count invalidated binder delivery failure - #954

Closed
LIghtJUNction wants to merge 4 commits into
JingMatrix:masterfrom
LIghtJUNction:master
Closed

fix: count invalidated binder delivery failure#954
LIghtJUNction wants to merge 4 commits into
JingMatrix:masterfrom
LIghtJUNction:master

Conversation

@LIghtJUNction

Copy link
Copy Markdown
Contributor

This pull request introduces a new mechanism for tracking and managing delivery attempts for module app services, replacing the previous approach based on a simple set of active uids. It adds a robust DeliveryAttemptTracker to handle concurrency, lifecycle invalidation, and stale attempt cleanup, and updates the service logic to use this tracker. Additionally, it improves reliability under failure conditions and adds unit tests for the new tracker. The Gradle build is also updated to include unit tests for the daemon module.

Delivery attempt tracking and concurrency improvements:

  • Introduced DeliveryAttemptTracker, a new class that serializes delivery attempts per uid and safely invalidates or completes them across lifecycle changes and concurrency boundaries. This replaces the previous sending set and ensures that only the correct, current attempt can affect state. (daemon/src/main/kotlin/org/matrix/vector/daemon/ipc/DeliveryAttemptTracker.kt)
  • Updated ModuleAppService to use DeliveryAttemptTracker for managing delivery attempts, including in uidStarts, uidGone, and delivery completion logic. This prevents race conditions, ensures proper cleanup, and avoids stale attempts from corrupting state. (daemon/src/main/kotlin/org/matrix/vector/daemon/ipc/ModuleAppService.kt) [1] [2] [3] [4]

Thread pool and resource management:

  • Changed the binder executor from an unbounded cached thread pool to a fixed thread pool of 4, preventing unbounded thread growth under heavy event storms. (daemon/src/main/kotlin/org/matrix/vector/daemon/ipc/ModuleAppService.kt)

Reliability and failure handling:

  • Improved failure accounting to ensure that invalidated or replaced attempts do not interfere with new attempts, and that failures are properly recorded without losing events due to concurrency. (daemon/src/main/kotlin/org/matrix/vector/daemon/ipc/ModuleAppService.kt)

Testing and build system:

  • Added unit tests for DeliveryAttemptTracker to verify correct handling of duplicate starts, invalidation, stale attempts, and concurrency. (daemon/src/test/kotlin/org/matrix/vector/daemon/ipc/DeliveryAttemptTrackerTest.kt)
  • Updated the Gradle build to include JUnit as a test dependency and to run daemon unit tests in the CI workflow. (daemon/build.gradle.kts, .github/workflows/core.yml) [1] [2]

Invalidate asynchronous delivery work when module UIDs disappear or the
module cache is reset, and scope death recipients to the Binder they watch.
Bound the delivery workers and add regression coverage for duplicate, stale,
and reset attempts.

Signed-off-by: LIghtJUNction <lightjunction.me@gmail.com>
…very

fix: prevent stale module binder deliveries
Canary publishing creates canary-* tags in the repository. Restrict the distribution version provider to stable v* tags so those generated tags cannot put a hyphenated canary name into artifact filenames and break the release workflow's field parsing.

Run a verification task in Core CI against the checkout's real tags so a canary version selection fails before packaging.
Copilot AI lite review requested due to automatic review settings August 31, 2026 18:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JingMatrix

Copy link
Copy Markdown
Owner

Pause this pull-request until a real issue can be linked to it.

We don't need AI-based improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants