Skip to content

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Sep 3, 2025

Cherry-pick of #84064

  • 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

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

@artemcm artemcm requested a review from nkcsgexi September 3, 2025 19:29
@artemcm artemcm requested a review from a team as a code owner September 3, 2025 19:29
@artemcm artemcm added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Sep 3, 2025
@artemcm
Copy link
Contributor Author

artemcm commented Sep 3, 2025

@swift-ci test

…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 force-pushed the 62_DepScanWorkersNoShareDiagEngine branch from cb278e2 to 0fa722f Compare September 3, 2025 20:55
@artemcm
Copy link
Contributor Author

artemcm commented Sep 3, 2025

@swift-ci test

@artemcm artemcm enabled auto-merge September 4, 2025 16:25
@artemcm artemcm merged commit fdaafd6 into swiftlang:release/6.2 Sep 4, 2025
5 checks passed
@artemcm artemcm deleted the 62_DepScanWorkersNoShareDiagEngine branch September 4, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks swift 6.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants