Skip to content

policy: fix concurrent open waiter deadlock in sourcemeta Resolver#3659

Closed
crazy-max wants to merge 1 commit intodocker:masterfrom
crazy-max:sourcemeta-deadlock
Closed

policy: fix concurrent open waiter deadlock in sourcemeta Resolver#3659
crazy-max wants to merge 1 commit intodocker:masterfrom
crazy-max:sourcemeta-deadlock

Conversation

@crazy-max
Copy link
Member

@crazy-max crazy-max commented Feb 20, 2026

fixes #3658

This PR removes a deadlock in util/sourcemeta.Resolver.open(). Under concurrent calls, only one goroutine could receive from r.ready while others waited forever; on Windows this race was easier to hit and caused the 30m timeout encountered in #3658. The change adds a one-time open-complete broadcast (opened) that is closed when open succeeds or fails, so all waiters wake up, re-check shared state, and return without blocking.

Can be tested with:

go test -run TestResolverConcurrentResolveUsesSingleOpen -count=500 -timeout 120s ./util/sourcemeta

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max requested a review from tonistiigi February 20, 2026 08:49
@crazy-max crazy-max marked this pull request as ready for review February 20, 2026 08:49
@tonistiigi
Copy link
Member

I already had a patch for this in 675ceb5

@crazy-max
Copy link
Member Author

I already had a patch for this in 675ceb5

Ah my bad didn't review #3657 yet. Closing this one.

@crazy-max crazy-max closed this Feb 20, 2026
@crazy-max crazy-max deleted the sourcemeta-deadlock branch February 20, 2026 15:50
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.

Flaky test: TestResolverConcurrentResolveUsesSingleOpen

2 participants