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 2022/01/03 23:35:46 UTC

[GitHub] [bookkeeper] dlg99 commented on a change in pull request #2962: Fix Journal.ForceWriteThread.forceWriteRequests.put deadlock

dlg99 commented on a change in pull request #2962:
URL: https://github.com/apache/bookkeeper/pull/2962#discussion_r777747292



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
##########
@@ -509,7 +510,7 @@ public void run() {
                             // queue will benefit from this force write - post a marker prior to issuing
                             // the flush so until this marker is encountered we can skip the force write
                             if (enableGroupForceWrites) {
-                                forceWriteRequests.put(createForceWriteRequest(req.logFile, 0, 0, null, false, true));
+                                forceWriteMarkerSent = forceWriteRequests.offer(createForceWriteRequest(req.logFile, 0, 0, null, false, true));

Review comment:
       consider logging and incrementing a counter (for monitoring/alerting/troubleshooting) if forceWriteMarkerSent is false.

##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
##########
@@ -509,7 +510,7 @@ public void run() {
                             // queue will benefit from this force write - post a marker prior to issuing
                             // the flush so until this marker is encountered we can skip the force write
                             if (enableGroupForceWrites) {
-                                forceWriteRequests.put(createForceWriteRequest(req.logFile, 0, 0, null, false, true));
+                                forceWriteMarkerSent = forceWriteRequests.offer(createForceWriteRequest(req.logFile, 0, 0, null, false, true));

Review comment:
       createForceWriteRequest uses pool; if offer failed we need to recycle the request to avoid leak.




-- 
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