Skip to content

fix(collector): ignore shutdown closed signal in stop - #459

Merged
bbingz merged 1 commit into
mainfrom
fix/collector-stop-closed-20261010
Oct 10, 2026
Merged

bbingz merged 1 commit into
mainfrom
fix/collector-stop-closed-20261010

Conversation

@bbingz

@bbingz bbingz commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

CollectorRuntime.stop set stopping and then joined the live capture and upload loops. A turn that observed stopping threw CollectorRuntimeError.closed. When that error won the race against CancellationError, stop reported it as a producer failure.

On 2026-10-08 this failed three swift-unit jobs, all with caught error: "closed", and each passed on rerun:

Background turns now throw CancellationError once stopping is set. stop also treats an already-thrown .closed from the joined loop or cycle as the same shutdown signal. runOnce after a finished stop still throws .closed. invalidConfiguration and reconciliationRequired still fail the join.

Test plan

  • Local xcodebuild test -scheme EngramServiceCore -only-testing:EngramServiceCoreTests/CollectorRuntimeTests: 82 tests, 0 failures (2026-10-08, before this commit's changelog wording tweak). The new repro failed with closed before the fix.
  • PR swift-unit passes without a rerun of those two tests.

The untracked .grok/workflows/engram-session-status.rhai is not part of this change.

stop set stopping and then joined the live capture and upload loops.
A turn that observed stopping threw CollectorRuntimeError.closed, and
when that beat CancellationError, stop reported a producer failure.
swift-unit hit this on 2026-10-08 in the replay-loss and start-loop tests.

Background turns now throw CancellationError once stopping is set.
stop also treats an already-thrown closed error from the joined loop
or cycle as the same shutdown signal. runOnce after stop still throws
closed. invalidConfiguration and reconciliationRequired still fail
the join.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T00:50:30.226216Z 33713cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bbingz
bbingz merged commit d9d846f into main Oct 10, 2026
16 checks passed
@bbingz
bbingz deleted the fix/collector-stop-closed-20261010 branch October 10, 2026 01:27
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