Github user wuwen5 commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/119#discussion_r91682496 --- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java --- @@ -1495,10 +1504,21 @@ public ReplyHeader submitRequest(RequestHeader h, Record request, Packet packet = queuePacket(h, r, request, response, null, null, null, null, watchRegistration, watchDeregistration); synchronized (packet) { + long waitStartTime = System.currentTimeMillis(); while (!packet.finished) { - packet.wait(); + packet.wait(requestTimeout); + if (!packet.finished && ((System.currentTimeMillis() --- End diff -- System.currentTimeMillis() is dependent on System clock. It probably micro-corrected by an external programme.. I think using System.nanoTime() to measure elapsed time is the correct solution.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---