kezhuw opened a new issue #2948: URL: https://github.com/apache/bookkeeper/issues/2948
**BUG REPORT** ***Describe the bug*** `Journal.forceWriteRequests` is a blocking queue, it is solely consumed by `ForceWriteThread`, but `ForceWriteThread` also put blocking when posting group force write marker. ***To Reproduce*** I pushed a [reproducing branch](https://github.com/kezhuw/bookkeeper/tree/potential-deadlock-forceWriteRequests-put-reproducing) in my fork with commit https://github.com/kezhuw/bookkeeper/commit/fb70af10ac442db6af15c73123a6e7c33d01a421 to demonstrate this. ***Expected behavior*** Don't deadlock. ***Screenshots*** <img width="784" alt="Screen Shot 2021-12-18 at 12 34 27" src="https://user-images.githubusercontent.com/541734/146629031-25c6a9d5-ee7e-4d3a-bf94-8b33724245c7.png"> ***Additional context*** I think we could use `BlockingQueue.offer` instead of `BlockingQueue.put` to avoid this. When `BlockingQueue.offer` fails, warn in logging. Since `ForceWriteThread` is IO bounded(`JournalChannel.forceWrite`), so this change should not affect ack latency. This deadlock may only happen when `journalQueueSize` is configured as considerable small, while it should be large enough for good performance in production. Shall we fix it ? -- 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]
