ss77892 opened a new pull request, #11195:
URL: https://github.com/apache/ozone/pull/11195

   ## What changes were proposed in this pull request?
   XceiverClientGrpc.streamRead should wait for flow-control readiness via 
onReadyHandler instead of a 10 ms poll
   XceiverClientGrpc.streamRead() waits for the gRPC request stream to become 
ready (flow control) by polling isReady() in a loop with a 10 ms sleep between 
checks. This adds up to 10 ms of latency to every send that hits back-pressure, 
burns CPU on a busy client, and keeps the caller waiting for the full timeout 
if the call fails in the meantime, since a terminated stream never becomes 
ready.
   PR uses the readiness callback that gRPC already provides instead of 
polling. initStreamRead() now wraps the reader in a ClientResponseObserver so 
the onReadyHandler can be registered in beforeStart(), the only place gRPC 
allows it. The handler wakes the sender via 
StreamingReadResponse.signalReady().streamRead() calls the new 
StreamingReadResponse.awaitReady(timeout), which blocks on a monitor until the 
stream is ready, the timeout expires, or the call terminates. 
onError/onCompleted call signalTerminated(), so a sender blocked in 
awaitReady() fails immediately with the termination cause instead of waiting 
out the timeout.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-16324
   
   ## How was this patch tested?
   UTs has been added. 


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to