You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/12/18 04:49:48 UTC

[GitHub] [bookkeeper] kezhuw opened a new issue #2948: Deadlock on Journal.ForceWriteThread.forceWriteRequests.put when `journalQueueSize` is small

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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] kezhuw commented on issue #2948: Deadlock on Journal.ForceWriteThread.forceWriteRequests.put when `journalQueueSize` is small

Posted by GitBox <gi...@apache.org>.
kezhuw commented on issue #2948:
URL: https://github.com/apache/bookkeeper/issues/2948#issuecomment-1065793977


   Fixed by #2962 in 1b1e937.


-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] kezhuw closed issue #2948: Deadlock on Journal.ForceWriteThread.forceWriteRequests.put when `journalQueueSize` is small

Posted by GitBox <gi...@apache.org>.
kezhuw closed issue #2948:
URL: https://github.com/apache/bookkeeper/issues/2948


   


-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org