ivankelly commented on a change in pull request #817: Client times out requests 
in batch rather than individually
URL: https://github.com/apache/bookkeeper/pull/817#discussion_r156046133
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java
 ##########
 @@ -91,14 +88,11 @@ static PendingAddOp create(LedgerHandle lh, ByteBuf 
payload, AddCallback cb, Obj
         op.completed = false;
         op.ackSet = lh.distributionSchedule.getAckSet();
         op.addOpLogger = lh.bk.getAddOpLogger();
-        if (op.timeout != null) {
-            op.timeout.cancel();
-        }
-        op.timeout = null;
-        op.timeoutSec = lh.bk.getConf().getAddEntryQuorumTimeout();
+        op.timeoutNanos = 
TimeUnit.SECONDS.toNanos(lh.bk.getConf().getAddEntryQuorumTimeout());
         op.pendingWriteRequests = 0;
         op.callbackTriggered = false;
         op.hasRun = false;
+        op.requestTimeNanos = Long.MAX_VALUE;
 
 Review comment:
   It's defensively defaulting to disabling the timeout if we forget to set the 
start time of the request. Long.MAX_VALUE will always be in the future.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to