Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2034

Http2StreamSinkChannel.awaitWritable could throw "Out of control window" IOException before awaitWritable timeout has fully ellapsed

    XMLWordPrintable

Description

    After Http2StreamSinkChannel.awaitWritable invokes super.awaitWritable():

    https://github.com/undertow-io/undertow/blob/2.2.16.Final/core/src/main/java/io/undertow/protocols/http2/Http2StreamSinkChannel.java#L186

    It just checks for condition, without verifying if we should wait for the next flow control window update as long as we stay inside the await writable timeout before while waiting:

    https://github.com/undertow-io/undertow/blob/2.2.16.Final/core/src/main/java/io/undertow/protocols/http2/Http2StreamSinkChannel.java#L188

    As a result, we could have an IOException complaining of a flow control that has not been updated sooner than the client can actually send a flow control update.

    Notice that the super class awaitWritable just verifies if the channel is ready for flushed and not closed while waiting:

    https://github.com/undertow-io/undertow/blob/2.2.16.Final/core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedStreamSinkChannel.java#L288

    Naturally, this method is not aware of the flow control mechanism in HTTP2 and cannot verify for that condition. That's why it is important that the subclass method waits on the remaining time inside the timeout period before throwing an exception.

    Attachments

      Issue Links

        Activity

          People

            flaviarnn Flavia Rainone
            flaviarnn Flavia Rainone
            Brad Maxwell, David Lloyd, Flavia Rainone, Grzegorz Grzybek, Jason Lee, Joerg Baesner, Kunjan Rathod (Inactive), Masafumi Miura, Richard Opalka, Rodrigo Freire, Stefano Maestri, Stuart Douglas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: