Class Http2StreamWriteStallHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.mockserver.netty.connection.Http2StreamWriteStallHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler, Runnable

public final class Http2StreamWriteStallHandler extends io.netty.channel.ChannelDuplexHandler implements Runnable
Resets an HTTP/2 stream whose response has data waiting in the connection's flow controller that the client has taken none of for responseWriteStallTimeoutMillis. A client can stop granting one stream flow-control window while it keeps reading the connection, so a stalled stream is invisible at the connection level; WriteStallTimeoutHandler covers a connection whose socket stalls.

A stream progresses only when the flow controller writes some of its data, which WrittenBytesFlowController counts as it leaves. The window a client returns for a stream never counts as progress: it only tells which of the streams already timed out is reset first. What else spares a stream whose own window is open, and which stream is reset when one holds the connection window the others wait for, is in "Response Write-Stall Timeout" in docs/code/netty-pipeline.md.

Sits anywhere after the connection's Http2ConnectionHandler, whose remote flow controller it wraps. A timer runs only while the connection has active streams.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
    Http2StreamWriteStallHandler(long timeoutMillis, org.mockserver.logging.MockServerLogger mockServerLogger)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flush(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    run()
     

    Methods inherited from class io.netty.channel.ChannelDuplexHandler

    bind, close, connect, deregister, disconnect, read, write

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Http2StreamWriteStallHandler

      public Http2StreamWriteStallHandler(long timeoutMillis, org.mockserver.logging.MockServerLogger mockServerLogger)
  • Method Details

    • handlerAdded

      public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      handlerAdded in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerAdded in class io.netty.channel.ChannelHandlerAdapter
    • handlerRemoved

      public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      handlerRemoved in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerRemoved in class io.netty.channel.ChannelHandlerAdapter
    • flush

      public void flush(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      flush in interface io.netty.channel.ChannelOutboundHandler
      Overrides:
      flush in class io.netty.channel.ChannelDuplexHandler
    • run

      public void run()
      Specified by:
      run in interface Runnable