slfan1989 opened a new pull request, #1617: URL: https://github.com/apache/ratis/pull/1617
## What changes were proposed in this pull request? `SegmentedRaftLog.close()` acquires the write lock before calling `cacheEviction.close()`, which interrupts the cache eviction thread and waits for it to terminate using `Thread.join()`. If the eviction thread is waiting for the same write lock, a deadlock occurs: the closing thread waits for the eviction thread to terminate, while the eviction thread waits for the closing thread to release the lock. Interrupting the eviction thread does not resolve this because it acquires the lock using `lock()`. This PR moves `cacheEviction.close()` before acquiring the write lock, allowing the eviction thread to finish before the cache is cleared. ## What is the link to the Apache JIRA RATIS-2719. SegmentedRaftLog.close may deadlock with the cache eviction thread. ## How was this patch tested? https://github.com/slfan1989/ratis/actions/runs/36564811620 -- 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]
