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

   ## What changes were proposed in this pull request?
   HDDS-16680. StreamBlockInputStream returns EOF instead of failing over when 
an error response arrives during poll()
   
   StreamBlockInputStream.StreamingReader.poll() checks for errors only at the 
start of each loop iteration, before it waits on the response queue. If the 
datanode sends an error response (for example UNKNOWN_BCSID from a replica that 
has not applied the block yet) while poll() is waiting on an empty queue, 
onNext() calls setFailed(), which completes the reader's future exceptionally. 
When the wait ends, the queue is still empty and future.isDone() is true, so 
poll() returns null. The caller reads that as end of stream.
   As a result, the read returns EOF instead of throwing an IOException. 
handleExceptions() never sees an error, so the client does not fail over to 
another replica, and the application gets a short read.
   
   The fix calls checkError() before poll() returns null for a completed 
stream. An exceptionally completed future now surfaces as an IOException, and 
the normal retry and failover path handles it. A stream that completed normally 
still returns EOF
    as before.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16680
   
   ## How was this patch tested?
   
     Added UT.
   


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