Skip to content

QUEUE-144: restack Wire context listeners on corrected counts - #1281

Closed
peter-lawrey wants to merge 15 commits into
developfrom
codex/QUEUE-144-wire-post-146-v2
Closed

peter-lawrey wants to merge 15 commits into
developfrom
codex/QUEUE-144-wire-post-146-v2

Conversation

@peter-lawrey

@peter-lawrey peter-lawrey commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Purpose

Corrected QUEUE-144 Wire foundation, retaining the accepted count/API/lifecycle work while excluding deferred adapters and Queue recovery.

Scope

  • fail-closed listener lifecycle at the common write boundary;
  • incomplete chains and listener-internal rollback poison the current context;
  • generated, proxy-fallback and explicit proxy writers use the frozen supplied output;
  • Binary, Text, YAML and RawWire completion/rollback parity;
  • direct WireInternal.writeData() failures restore the pre-header position, notify lifecycle rollback and rethrow;
  • metadata is rejected after listener failure;
  • unavailable count is exactly -1; DocumentContext.NOOP remains harmless;
  • reset/clear re-entrancy protection and pre-mutation overflow rejection.

Deferred: HTTP/file/String adapters and Queue recovery support.

Dependency and validation

Exact head: c37b3008cc168595b17374171ea3284c5acbbeb5.

Focused WireContextListenerLifecycleTest: 21 tests, 0 failures, covering direct write/document entry points across all four retained Wire types. mvn -DskipTests install also passed binary compatibility enforcement.

Exact-head CI, immutable artifact publication and fresh review remain merge gates.

@peter-lawrey

Copy link
Copy Markdown
Member Author

Reviewer follow-up for the Wire composition:

Implemented:

  • incomplete chained listener output is rolled back and poisons the current context before it can be marked successful;
  • RawWire delegates real completion/rollback state;
  • metadata is rejected after listener failure;
  • generated and forced-proxy writers share a frozen supplied-output binding;
  • DocumentContext.NOOP remains IgnoresEverything/harmless while reporting unavailable count correctly;
  • the stale functional-requirement test reference was corrected.

Full mvn -q clean verify passes at exact head 9d9a711ae (11,384 tests), including complete/incomplete chain coverage across Binary, Text, YAML and RawWire with generated and forced-proxy writers.

Deliberately not implemented: HTTP/file/String adapters (#1273), Queue EOF recovery (#1275), and the old source/provenance branch (#1268). They are not required by the first QUEUE-144 release and would reintroduce unresolved adapter-delivery or duplicated recovery ownership.

@peter-lawrey

Copy link
Copy Markdown
Member Author

Review update for exact head 32bf312a764416efddd32156c22e4a21b5703b65.

Implemented:

  • listener serialization failure is logged once without payload, poisons that output context, rethrows the original failure, and is not retried by later writes;
  • application rollback after successful context publication poisons the lifecycle rather than allowing later context-free payload;
  • Text/YAML initialise their lazy write document context before notification;
  • generated and forced-proxy method writers use the supplied listener output consistently;
  • incomplete chained listener output is rejected/rolled back across Binary, Text, YAML, and RawWire;
  • DocumentContext.NOOP compatibility and unavailable count semantics are retained.

Not implemented: automatic retry/repair, ProgressiveContext, HTTP/file/String adapters, Queue recovery, named-tailer replay, or buffered transport support. Recovery is only through an explicit lifecycle boundary (Wire reset, Queue roll, or reconnect downstream).

Focused lifecycle/proxy tests and full local clean verify pass. The PR remains draft pending fresh review and cross-platform CI.

@peter-lawrey

Copy link
Copy Markdown
Member Author

Review update

Exact head: 8bc03b1.

Implemented:

  • Listener-internal rollback is recorded while IN_PROGRESS, then logged once, rolled back and made permanently failed for that context.
  • The explicit proxyClass path now receives the same frozen output supplier as generated writers and the Java proxy fallback.
  • Coverage includes Binary, Text, YAML and RawWire with generated, forced fallback and precompiled proxy paths.
  • Focused lifecycle tests pass.
  • mvn -q clean verify passed outside the sandbox: more than 11,000 tests.

Deliberately not implemented:

  • No automatic retry after listener or application rollback; the lifecycle remains fail-closed until a real reset boundary.
  • HTTP, file and String adapters remain deferred.
  • ProgressiveContext remains excluded.

Queue #1746 was validated against a local installation of this exact snapshot. An immutable Wire/BOM release is still required for release validation.

@peter-lawrey

Copy link
Copy Markdown
Member Author

Reviewer handoff for exact head c37b3008c:

Implemented:

  • all direct WireInternal.writeData() entry points now capture the pre-header position;
  • any payload/header/finalization throwable restores that position, notifies lifecycle rollback/failure, and rethrows;
  • regressions cover Binary, Text, YAML and RawWire through writeDocument, writeNotCompleteDocument and Wires.writeData().

Validation performed:

  • WireContextListenerLifecycleTest: 21 tests, 0 failures;
  • mvn -DskipTests install: success, including binary compatibility enforcement.

Not done:

  • I did not rerun the full 11k-test clean verify at this head, so that older claim was removed from the PR body. Exact-head CI remains the broader evidence gate.

@peter-lawrey

Copy link
Copy Markdown
Member Author

Superseded by #1280. Its corrected final QUEUE-144 tree is now the foundation of the single staged/develop delivery PR, followed by the focused QUEUE-146 EOF boundary commit.

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.

1 participant