Fix parDemuxScan deadlock when worker throws with full buffer#3189
Open
johnhampton wants to merge 1 commit intocomposewell:masterfrom
Open
Fix parDemuxScan deadlock when worker throws with full buffer#3189johnhampton wants to merge 1 commit intocomposewell:masterfrom
johnhampton wants to merge 1 commit intocomposewell:masterfrom
Conversation
Signal the driver thread when a worker exception occurs so it can wake up from blocking on a full input buffer. Previously sendExceptionToDriver only wrote to the output queue, leaving the driver stuck on takeMVar. - Set closedForInput and signal inputSpaceDoorBell in sendExceptionToDriver - Add regression test with slow single-key worker that throws mid-stream - Test confirms original exception propagates instead of BlockedIndefinitelyOnMVar
Member
|
Thanks for the PR @johnhampton . I will take a deeper look and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a fold worker throws an exception while the driver is blocked on a full input buffer,
sendExceptionToDriverwrites to the output queue but never signals the driver. The driver remains stuck ontakeMVar, and GHC's runtime eventually throwsBlockedIndefinitelyOnMVar, masking the original exception entirely.Signal
inputSpaceDoorBelland setclosedForInputinsendExceptionToDriverso the driver can wake up. Add regression test.This fix was implemented with AI assistance (Claude, Anthropic).