New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #6603 - HTTP/2 max local stream count exceeded #6639
Changes from 2 commits
6ea6bda
cb102d9
a1297ca
e4d1fb9
5834e5f
7b78b90
c3a19a6
216616a
9caf6fa
e27f192
7733d0f
97f4ef3
aa3e7de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,6 +28,7 @@ | |||||||||||
import java.util.concurrent.atomic.AtomicBoolean; | ||||||||||||
import java.util.concurrent.atomic.AtomicInteger; | ||||||||||||
|
||||||||||||
import org.eclipse.jetty.client.ConnectionPool; | ||||||||||||
import org.eclipse.jetty.client.HttpChannel; | ||||||||||||
import org.eclipse.jetty.client.HttpConnection; | ||||||||||||
import org.eclipse.jetty.client.HttpDestination; | ||||||||||||
|
@@ -42,7 +43,7 @@ | |||||||||||
import org.eclipse.jetty.util.log.Logger; | ||||||||||||
import org.eclipse.jetty.util.thread.Sweeper; | ||||||||||||
|
||||||||||||
public class HttpConnectionOverHTTP2 extends HttpConnection implements Sweeper.Sweepable | ||||||||||||
public class HttpConnectionOverHTTP2 extends HttpConnection implements Sweeper.Sweepable, ConnectionPool.Multiplexable | ||||||||||||
{ | ||||||||||||
private static final Logger LOG = Log.getLogger(HttpConnection.class); | ||||||||||||
|
||||||||||||
|
@@ -52,6 +53,7 @@ public class HttpConnectionOverHTTP2 extends HttpConnection implements Sweeper.S | |||||||||||
private final AtomicInteger sweeps = new AtomicInteger(); | ||||||||||||
private final Session session; | ||||||||||||
private boolean recycleHttpChannels = true; | ||||||||||||
private int maxMultiplex = 1; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is duplicated state... which is almost always bad. See below: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Argh!!! it id worse!!! This is triple state as it is also stored in Http2Session, but at least there is is kept correctly as the local and remote value. |
||||||||||||
|
||||||||||||
public HttpConnectionOverHTTP2(HttpDestination destination, Session session) | ||||||||||||
{ | ||||||||||||
|
@@ -74,6 +76,16 @@ public void setRecycleHttpChannels(boolean recycleHttpChannels) | |||||||||||
this.recycleHttpChannels = recycleHttpChannels; | ||||||||||||
} | ||||||||||||
|
||||||||||||
public int getMaxMultiplex() | ||||||||||||
{ | ||||||||||||
return maxMultiplex; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid duplicate state:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sbordet I think this could at least remove some state duplication.... but might not be needed if we can delegate all the way down to HTTP2Session. |
||||||||||||
} | ||||||||||||
|
||||||||||||
public void setMaxMultiplex(int maxMultiplex) | ||||||||||||
{ | ||||||||||||
this.maxMultiplex = maxMultiplex; | ||||||||||||
} | ||||||||||||
|
||||||||||||
@Override | ||||||||||||
protected Iterator<HttpChannel> getHttpChannels() | ||||||||||||
{ | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming the 1 is there until overridden by the settings frame? Eitherway a comment would be good explaining why 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.