Author: remm
Date: Tue Mar  7 10:24:38 2017
New Revision: 1785820

URL: http://svn.apache.org/viewvc?rev=1785820&view=rev
Log:
Unlock a blocking read (with an IOE) when a stream exception occurs. The likely 
bad behavior is seen in many tests in the testsuite. Originally I think this is 
supposed to wait for a reset frame, but I don't really see a benefit.

Modified:
    tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
    tomcat/trunk/java/org/apache/coyote/http2/Stream.java

Modified: tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties?rev=1785820&r1=1785819&r2=1785820&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/LocalStrings.properties Tue Mar  
7 10:24:38 2017
@@ -85,6 +85,7 @@ stream.write=Connection [{0}], Stream [{
 stream.inputBuffer.copy=Copying [{0}] bytes from inBuffer to outBuffer
 stream.inputBuffer.dispatch=Data added to inBuffer when read interest is 
registered. Triggering a read dispatch
 stream.inputBuffer.empty=The Stream input buffer is empty. Waiting for more 
data
+stream.inputBuffer.reset=Stream reset
 stream.inputBuffer.signal=Data added to inBuffer when read thread is waiting. 
Signalling that thread to continue
 
 stream.outputBuffer.flush.debug=Connection [{0}], Stream [{1}], flushing 
output with buffer at position [{2}], writeInProgress [{3}] and closed [{4}]

Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1785820&r1=1785819&r2=1785820&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Tue Mar  7 10:24:38 
2017
@@ -470,6 +470,10 @@ class Stream extends AbstractStream impl
         } else {
             handler.closeConnection(http2Exception);
         }
+        // Reads wait internally so need to call a method to break the wait()
+        if (inputBuffer != null) {
+            inputBuffer.receiveReset();
+        }
     }
 
 
@@ -691,8 +695,7 @@ class Stream extends AbstractStream impl
                         }
                         inBuffer.wait();
                         if (reset) {
-                            // TODO: i18n
-                            throw new IOException("HTTP/2 Stream reset");
+                            throw new 
IOException(sm.getString("stream.inputBuffer.reset"));
                         }
                     } catch (InterruptedException e) {
                         // Possible shutdown / rst or similar. Use an



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

Reply via email to