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_r168380336
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
 ##########
 @@ -990,6 +1012,69 @@ void asyncRecoveryAddEntry(final byte[] data, final int 
offset, final int length
         doAsyncAddEntry(op);
     }
 
+    private boolean isWritesetWritable(DistributionSchedule.WriteSet writeSet, 
int allowedNonWritableCount) {
+        if (allowedNonWritableCount < 0) {
+            allowedNonWritableCount = 0;
+        }
+
+        int nonWritableCount = 0;
+        for (int i = 0; i < writeSet.size(); i++) {
+            if 
(!bk.getBookieClient().isWritable(metadata.currentEnsemble.get(i))) {
+                nonWritableCount++;
+            }
+            if (nonWritableCount > 0 && nonWritableCount >= 
allowedNonWritableCount) {
 
 Review comment:
   If it is a positive check, >= minWritableChannels then return true; then you 
don't need to check all bookie channels.

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