Skip to content

Commit

Permalink
Issue #6208 - HTTP/2 max local stream count exceeded
Browse files Browse the repository at this point in the history
Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Apr 28, 2021
1 parent 0b315d7 commit 967e13d
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -69,8 +69,10 @@
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -464,7 +466,8 @@ public Stream.Listener onNewStream(Stream stream, HeadersFrame frame)
break;
}
}
return null;
// Return a Stream listener that consumes the content.
return new Stream.Listener.Adapter();
}
});
http2.setMaxConcurrentStreams(2);
Expand Down Expand Up @@ -509,8 +512,7 @@ public Connection newConnection(EndPoint endPoint, Map<String, Object> context)
while (!clientEndPoint.getWriteFlusher().isPending())
{
long elapsed = System.nanoTime() - start;
if (TimeUnit.NANOSECONDS.toSeconds(elapsed) > 15)
throw new TimeoutException();
assertThat(TimeUnit.NANOSECONDS.toSeconds(elapsed), Matchers.lessThan(15L));
Thread.sleep(100);
}
// Wait for the selector to update the SelectionKey to OP_WRITE.
Expand Down Expand Up @@ -539,7 +541,7 @@ public Connection newConnection(EndPoint endPoint, Map<String, Object> context)
// Resolve the TCP congestion.
request1Latch.countDown();

assertTrue(response1Latch.await(5, TimeUnit.SECONDS));
assertTrue(response1Latch.await(15, TimeUnit.SECONDS));
assertTrue(response3Latch.await(5, TimeUnit.SECONDS));
}

Expand Down

0 comments on commit 967e13d

Please sign in to comment.