ivandika3 opened a new pull request, #11729: URL: https://github.com/apache/ozone/pull/11729
## What changes were proposed in this pull request? There is an identified deadlock during in `BackgroundContainerDataScanner` when these two `BackgroundContainerScanner#shutdown` are called concurrently by these two callers - Shutdown thread calls: `OzoneContainer#stopContainerScrub` - Scanner thread (`scannerThread`) calls `BackgroundContainerDataScanner#scanContainer` when it found the volume failed The deadlock interleavings in chronological order 1. (Shutdown thread) calls `OzoneContainer#stopContainerScrub` 1. (Shutdown thread) `BackgroundContainerScanner#shutdown` is called holding the monitor lock of `BackgroundContainerScanner` 1. (Scanner thread) `scannerThread` found a failed volume and calls `BackgroundContainerScanner#shutdown` as well 1. (Scanner thread) `scannerThread` is **blocked** waiting for the monitor held by the Shutdown thread 1. (Shutdown thread) `BackgroundContainerScanner#shutdown` calls `AbstractBackgroundContainerScanner#shutdown` 1. (Shutdown thread) `AbstractBackgroundContainerScanner` interrupts the `scannerThread` and waits for it (i.e. `scannerThread#join` 1. (Shutdown thread) Since `scannerThread` is **blocked** waiting for the monitor Thread.join will block forever and shutdown thread is now blocked due to this deadlock cycle. Generated-by: GPT 6.1 Sol ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17380 ## How was this patch tested? UT. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
