Skip to content

HTTP/2 max local stream count exceeded when request fails #2796

Closed
@sbordet

Description

@sbordet
Contributor
java.lang.IllegalStateException: Max local stream count 2 exceeded
        at org.eclipse.jetty.http2.HTTP2Session.createLocalStream(HTTP2Session.java:696)
        at org.eclipse.jetty.http2.HTTP2Session.newStream(HTTP2Session.java:491)
        at org.eclipse.jetty.http2.client.http.HttpSenderOverHTTP2.sendHeaders(HttpSenderOverHTTP2.java:93)
        at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:212)
        at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.send(HttpChannelOverHTTP2.java:95)
        at org.eclipse.jetty.client.HttpChannel.send(HttpChannel.java:128)
        at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:201)
        at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.send(HttpConnectionOverHTTP2.java:72)
        at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:38)
        at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:347)
        at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:305)
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:295)
        at org.eclipse.jetty.client.HttpDestination.release(HttpDestination.java:400)
        at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.release(HttpConnectionOverHTTP2.java:99)
        at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.release(HttpChannelOverHTTP2.java:101)
        at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.exchangeTerminated(HttpChannelOverHTTP2.java:121)
        at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:465)
        at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:552)
        at org.eclipse.jetty.client.HttpChannel.abortResponse(HttpChannel.java:156)
        at org.eclipse.jetty.client.HttpChannel.abort(HttpChannel.java:149)
        at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.abort(HttpChannelOverHTTP2.java:108)
        at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:257)
        at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141)
        at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:767)
        at org.eclipse.jetty.client.TimeoutCompleteListener.onTimeoutExpired(TimeoutCompleteListener.java:52)
        at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:271)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:299)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.base/java.lang.Thread.run(Thread.java:844)

Activity

sbordet

sbordet commented on Aug 13, 2018

@sbordet
ContributorAuthor

The issue is that HttpChannelOverHTTP2.abort() first calls super and then resets the stream.
Unfortunately, calling super returns the connection to the pool, which will then be available for another stream before the aborted stream is closed, which would decrease the local stream count.

added a commit that references this issue on Aug 13, 2018

Fixes #2796 - Max local stream count exceeded when request fails.

35541d0
added a commit that references this issue on Aug 14, 2018

Merge pull request #2797 from eclipse/jetty-9.4.x-2796-max_concurrent…

03af18c
added a commit that references this issue on Oct 9, 2018

Issue #2796 - Max local stream count exceeded when request fails.

added a commit that references this issue on Oct 11, 2018

Issue #2796 - Max local stream count exceeded when request fails.

added a commit that references this issue on Oct 18, 2018

Issue #2796 - Max local stream count exceeded when request fails.

added 2 commits that reference this issue on Oct 30, 2018

Issue #2796 - Max local stream count exceeded when request fails.

Merge pull request #2965 from eclipse/jetty-9.4.x-2796-http2_max_conc…

11abe53
changed the title [-]Max local stream count exceeded when request fails[/-] [+]HTTP/2 max local stream count exceeded when request fails[/+] on Nov 6, 2018
added a commit that references this issue on Aug 22, 2020

Issue #5147 - HTTP2 RoundRobinConnectionPool with maxUsage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sbordet

        Issue actions

          HTTP/2 max local stream count exceeded when request fails · Issue #2796 · jetty/jetty.project