Skip to content

AsyncQueue: await dependencies concurrently to avoid priority inversion#57

Merged
rintaro merged 1 commit into
swiftlang:mainfrom
rintaro:asyncqueue-concurrent-deps
May 27, 2026
Merged

AsyncQueue: await dependencies concurrently to avoid priority inversion#57
rintaro merged 1 commit into
swiftlang:mainfrom
rintaro:asyncqueue-concurrent-deps

Conversation

@rintaro
Copy link
Copy Markdown
Member

@rintaro rintaro commented May 27, 2026

A sequentially-awaited list of dependency tasks only propagates a priority escalation to the dependency currently being awaited. The rest stay at their original priority and can starve under load, producing nondeterministic multi-minute hangs in tests that mix self-serializing and non-self-serializing metadata (e.g. a serial task waiting on many concurrent tasks).

Replace the sequential await with concurrentForEach so a priority escalation on the running task reaches every dependency at once.

Speculative fix for rdar://178006261

A sequentially-awaited list of dependency tasks only propagates a
priority escalation to the dependency currently being awaited. The
rest stay at their original priority and can starve under load,
producing nondeterministic multi-minute hangs in tests that mix
self-serializing and non-self-serializing metadata (e.g. a serial
task waiting on many concurrent tasks).

Replace the sequential await with concurrentForEach so a priority
escalation on the running task reaches every dependency at once.

Speculative fix for rdar://178006261
@rintaro rintaro merged commit 60d0e50 into swiftlang:main May 27, 2026
52 of 53 checks passed
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.

3 participants