kezhuw opened a new pull request, #1887:
URL: https://github.com/apache/zookeeper/pull/1887

   Place `Thread.sleep(200)` after `submittedRequests.take()` in
   `RequestThrottler#run` will fail two assertions:
   1. `assertEquals(2L, (long) metrics.get("prep_processor_request_queued"))`
   2. `assertEquals(1L, (long) metrics.get("request_throttle_wait_count"))`
   
   This happens due to `setStale` chould happen before throttle handling.
   
   This commit solves this by introducing an interception point
   `RequestThrottler.throttleSleep` to build happen-before relations:
   1. `throttling.countDown` happens before `setStale`, this ensures that
      unthrottled request are processed as usual.
   2. `setStale` happens before `throttled.await`, this defends
      `RequestThrottler.throttleSleep` against spurious wakeup.
   
   Sees also #1821.


-- 
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: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to