Skip to content

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Sep 4, 2025

Cherry-pick of #84089

  • Explanation: When multiple workers encounter a diagnostic simultaneously we can encounter races which lead to corrupted diagnostic data or crashes due to the workers sharing a common DiagnosticEngine. This change gives each worker a unique diagnostic engine, with all workers' engines sharing a thread-safe diagnostic collecting consumer.

  • Scope: Builds with explicitly-built modules where the scanning action encounters concurrent error diagnostics while scanning modules or instantiating Clang scanners.

  • Risk: Low. This change removes shared mutable state and is not expected to have adverse effects on the scanner functionality.

  • Problem: rdar://159598539

  • Reviewed By: @cachemeifyoucan, @nkcsgexi

  • Original PR: [6.2 🍒][Dependency Scanning] Give each scanner worker a unique Diagnostic Engine #84089

…ic Engine

Otherwise, when multiple workers encounter a diagnostic simultaneously we can encounter races which lead to corrupted diagnostic data or crashes

Resolves rdar://159598539
@artemcm artemcm requested a review from a team as a code owner September 4, 2025 20:20
@artemcm artemcm changed the title [6.2.1 🍒][Dependency Scanning] Give each scanner worker a unique Diagnost… [6.2.1 🍒][Dependency Scanning] Give each scanner worker a unique Diagnostic Engine Sep 4, 2025
@artemcm
Copy link
Contributor Author

artemcm commented Sep 4, 2025

@swift-ci test

@artemcm artemcm merged commit 174636c into swiftlang:release/6.2.1 Sep 8, 2025
5 checks passed
@artemcm artemcm deleted the 62_1_DepScanWorkersNoShareDiagEngine branch September 8, 2025 16:14
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.

2 participants