Skip to content

[DependencyScanning] Isolate DependencyScanningTool reset operations #71399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Feb 5, 2024

Guard resetCache and resetDiagnostics as critical sections using DependencyScanningToolStateLock. Otherwise there's a chance that one thread in the scanner is doing a reset on the diagnostic consumer, while some other thread is adding this diagnostic consumer to another scan instance which may also be populating said consumer at the time. Similarly, for resetting 'ScanningService' though it is much more unlikely to be reset while in-use by other scanning actions.

@artemcm
Copy link
Contributor Author

artemcm commented Feb 5, 2024

@swift-ci test

@artemcm artemcm enabled auto-merge February 5, 2024 21:54
Guard 'resetCache' and 'resetDiagnostics' as critical sections using 'DependencyScanningToolStateLock'. Otherwise there's a chance that one thread in the scanner is doing a reset on the diagnostic consumer, while some other thread is adding this diagnostic consumer to another scan instance which may also be populating said consumer at the time. Similarly, for resetting 'ScanningService' though it is much more unlikely to be reset while in-use by other scanning actions.
@artemcm artemcm force-pushed the DependencyScanningToolIsolation branch from c371396 to 0046165 Compare February 6, 2024 00:00
@artemcm
Copy link
Contributor Author

artemcm commented Feb 6, 2024

@swift-ci smoke test

@artemcm artemcm merged commit 7e9fee0 into swiftlang:main Feb 6, 2024
@artemcm artemcm deleted the DependencyScanningToolIsolation branch February 6, 2024 16:19
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