michaeljmarshall opened a new pull request, #3486:
URL: https://github.com/apache/bookkeeper/pull/3486

   ### Motivation
   
   When a client disconnects from a bookie server, there is a chance that there 
are pending read requests in the `BookieRequestProcessor`'s queue. Since these 
are read operations cannot succeed, there is no reason to attempt them.
   
   The primary motivation is to prevent unnecessary reads to the disk as well 
as decrease the memory utilization associated with unnecessary reads. 
Additionally, reads are currently performed as blocking calls on the 
`BookieRequestProcessor` processing thread pool, so failing fast can increase 
the processing speed of the thread pool. See:
   
   
https://github.com/apache/bookkeeper/blob/a65e888b25eb966921ff39032e04f367a553d634/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java#L57-L58
   
   Note: we cannot add this logic for writes because those can be "recovered" 
when the client reconnects.
   
   ### Changes
   
   * Only process a read request if the channel is open.
   
   ### Alternative Designs
   
   If we are concerned about the cost of reading the volatile variable from the 
channel, we could possibly speed up the logic by only running the check if the 
operation has been enqueued for over some threshold, like 100 millis.


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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to