Skip to content

[engine] Async post-shutdown task undo is best-effort with asyncOperationsQueueImpl=fast (Conversant queue lacks remove) #5066

Closed

Description

@lvca

Residual from #4954 (PR #5062): PushPullBlockingQueue (Conversant, arcadedb.asyncOperationsQueueImpl=fast) throws UnsupportedOperationException from remove(Object), so scheduleTask's post-shutdown undo (remove the task offered after the dead worker's final drain, then throw) degrades to best-effort: a task offered in that tiny window stays enqueued with completed() never called. The default 'standard' ArrayBlockingQueue is fully covered.

Options: a second drain pass on shutdown, or documenting the fast-queue limitation.

Discovered during the 2026-07 audit follow-up (#4962).

Activity

  1. self-assigned this
    on Jul 7, 2026
  2. added theissue type on Jul 7, 2026
  3. added this to the 26.7.2 milestone on Jul 7, 2026
  4. lvca commented on Jul 7, 2026

    @lvca
    MemberAuthor

    Unblocked: PR #5072 (which owned the surrounding removeQuietly/scheduleTask code) is merged. This issue is now free to fix without conflict.

  5. added a commit that references this issue on Jul 7, 2026
  6. lvca commented on Jul 7, 2026

    @lvca
    MemberAuthor

    Resolved in #5081 (merged). Investigation went a level deeper than the filed scope: the 'fast' async queue (PushPullBlockingQueue) is an explicit SPSC design, but every worker queue has many producers (application threads, cross-scheduling workers, completion markers, the closing thread) - so it was LOSING tasks in normal operation, not just failing the post-shutdown undo (demonstrated: an 8-producer regression test lost tasks on the old impl). The high-performance profile selects 'fast', so real deployments were exposed.

    Fix: 'fast' now maps to DisruptorBlockingQueue - the MPMC flagship from the same Conversant jar (no new dependency), with CAS-claimed sequences and a working remove(Object) that makes the originally-filed shutdown undo work identically on both impls. The second-drain-pass alternative was rejected with evidence (a producer holding a pre-shutdown snapshot can offer arbitrarily late, so no finite pass count is total). Red-first on both defects; the full async battery ran twice (default + -Darcadedb.asyncOperationsQueueImpl=fast), all green. A review round additionally hardened a pre-existing back-pressure divide-by-zero that the weakly-consistent Disruptor size estimates widened.

  7. added a commit that references this issue on Jul 8, 2026
  8. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions