jvrao commented on a change in pull request #1088: ISSUE #1086 (@bug 
W-4146427@) Client-side backpressure in netty (Fixes: 
io.netty.util.internal.OutOfDirectMemoryError under continuous heavy load)
URL: https://github.com/apache/bookkeeper/pull/1088#discussion_r168380594
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
 ##########
 @@ -791,6 +802,17 @@ public void onFailure(Throwable cause) {
                                                               long lastEntry) {
         PendingReadOp op = new PendingReadOp(this, bk.getScheduler(), 
firstEntry, lastEntry);
         if (!bk.isClosed()) {
+            // waiting on the first one.
+            // not very helpful if there are multiple ensembles or if bookie 
goes into unresponsive
+            // state later after N requests sent.
+            // unfortunately it seems thet alternatives are:
+            // - send reads one-by-one (our case anyway)
+            // - block worker pool (not good)
+            DistributionSchedule.WriteSet ws = 
distributionSchedule.getWriteSet(firstEntry);
+            if (!waitForWritable(ws, ws.size() - 1, waitForWriteSetMs)) {
+                op.enableFastFailOnBlockedWrite();
 
 Review comment:
   "blockedWrite" means channel write, but it might get confused for 
readability in readOp context. consider changing it to BlockedForChannel()

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to