Repository navigation
Conversation
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.
A
Thencallback that calls its parent Future'sCollect()deadlocks: the parent'sdonechannel is only closed after the callback returns. CallingCancel()or registering another callback on that parent also blocks on its mutex. Re-entering the original resolve callback blocks onsync.Once.Publish the result and close
doneunder the mutex, then run the existing synchronous callback chain after both the mutex and completion guard have been released. The first resolution/rejection still wins. This also means collecting the parent no longer waits for its descendant callbacks to finish.Five regression tests cover collecting resolved/rejected parents, cancelling a parent, chaining another callback from it, and attempting another resolution inside a callback. Each test reproduces a timeout against the unmodified base
502998f.Validation on Go 1.26.7 / macOS arm64:
go test -race ./..., build, vet, staticcheck and golangci-lint pass (0 lint issues).-race -count 1000.TestFutureOrderscheduling assumption. Repeating that unchanged test on base502998ffails the same way: it expects the caller's counter increment to precede an already-started goroutine. That test is left unchanged.git diff --checkpass.Developed and tested with OpenAI Codex assistance; no human review is claimed.