Skip to content

fix(runtime): drain shared-memory final close deterministically - #411

Closed
SunSi12138 wants to merge 1 commit into
devfrom
fix/387-shm-close-drain
Closed

SunSi12138 wants to merge 1 commit into
devfrom
fix/387-shm-close-drain

Conversation

@SunSi12138

Copy link
Copy Markdown
Owner

Part of #387.

SharedMemoryControlChannel.DisposeAsync previously started its 250 ms writer fallback immediately after queueing the final Close signal. On a heavily scheduled CI worker, that budget could expire before the writer continuation ever ran, allowing stream disposal to race ahead of the final control signal.

This change separates scheduler delay from a genuinely blocked write: when the writer is idle and there are no previously queued signals, disposal waits until the writer has actually dequeued the final Close (or the writer has already exited) before starting the existing bounded write-completion fallback. If a write is already active or work is already queued, the existing bounded cleanup behavior is preserved.

Regression tracked by SharedMemoryControlChannelTests.DisposeShouldDrainTheFinalCloseSignalBeforeCompletingWakeSource.

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