Skip to content

fix: double final-chunk race — demuxer sends tail as intermediate, handler owns final (#116) - #121

Merged
blaspat merged 1 commit into
mainfrom
fix/double-final-chunk
Aug 11, 2026
Merged

fix: double final-chunk race — demuxer sends tail as intermediate, handler owns final (#116)#121
blaspat merged 1 commit into
mainfrom
fix/double-final-chunk

Conversation

@blaspat

@blaspat blaspat commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What

The demuxer's finish() was sending the tail output as more=false (final chunk), then the handler was also sending a more=false chunk with metadata. This caused a double-finalization race on the server — the first more=false resolved the waiter, and the second hit a stale state, causing the node to disconnect.

Fix

Demuxer now sends tail as more=true (intermediate chunk). Only the handler sends the real more=false final chunk with exit_code, status, duration_ms, and truncated metadata. Single source of truth for completion.

Tested

  • go build ./... — clean
  • go test ./... — 7/7 pass

…ns final (#116)

Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
@blaspat
blaspat merged commit 6501fc9 into main Aug 11, 2026
14 checks passed
@blaspat
blaspat deleted the fix/double-final-chunk branch August 11, 2026 06:43
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