Github user juliuszsompolski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20555#discussion_r167651037
  
    --- Diff: core/src/main/java/org/apache/spark/io/ReadAheadInputStream.java 
---
    @@ -232,7 +229,9 @@ private void waitForAsyncReadComplete() throws 
IOException {
         stateChangeLock.lock();
         try {
           while (readInProgress) {
    +        isWaiting.set(true);
             asyncReadComplete.await();
    +        isWaiting.set(false);
    --- End diff --
    
    Good catch, I added `isWaiting.set(false)` to the finally branch.
    Actually, since the whole implementation assumes that there is only one 
reader, I removed the while() loop, since there is no other reader to race with 
us to trigger another read.
    
    In practice I think not updating `isWaiting` it would have been benign, as 
after the exception the query will be going down with an 
`InterruptedException`, or elsewise anyone upstream handling that exception 
would most probably declare that stream as unusable afterwards anyway.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to