Skip to content
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

h2c fails on 9.4.23.v20191118 Jetty Server and 1.1.0-SNAPSHOT jetty-reactive-httpclient #20

Closed
kptfh opened this issue Nov 19, 2019 · 8 comments

Comments

@kptfh
Copy link

kptfh commented Nov 19, 2019

After upgrade of ReactiveFeign Jetty-based implementation to 9.4.23.v20191118 Jetty Server and 1.1.0-SNAPSHOT jetty-reactive-httpclient H2c test began to fail. H1 version works correctly.

Test just tries to run 500 queries in parallel.
I get a lot of this warnings on server side
[qtp1378612814-18] WARN org.eclipse.jetty.server.HttpOutput - java.io.IOException: Closed while Pending/Unready
And then on client
java.io.IOException: cancel_stream_error

Last stable version that this test was passing is 9.4.14 and 1.0.2 jetty-reactive-httpclient

Here is the link to this test AllFeaturesTest
To run it locally you need to have 1.1.0-SNAPSHOT jetty-reactive-httpclient in local maven repository.

@sbordet
Copy link
Member

sbordet commented Nov 19, 2019

@kptfh I'm looking into this.

@kptfh
Copy link
Author

kptfh commented Nov 19, 2019

Probably issue on server side (which is also Jetty based) because the same test with Java 11 ReactiveFeign test is also failing
Java 11 ReactiveFeign against j2c Jetty server

@sbordet
Copy link
Member

sbordet commented Nov 19, 2019

This is an issue related to bad usage of the Servlet 3.1 async I/O APIs from Spring.

We have been able to reproduce the test failure with 9.4.23 but also 9.4.14 - the code that handles this case did not change.

We have filed jetty/jetty.project#4331 to track the behavior from the Servlet Specification point of view, but Spring should try harder to avoid calling Servlet APIs such as ServletOutputStream.close() or AsyncContext.complete() when previous writes are pending.

@kptfh
Copy link
Author

kptfh commented Nov 20, 2019

It's quite strange. Http1 version of the test works well.
Jetty ReactiveFeign against h1 Jetty server

@sbordet
Copy link
Member

sbordet commented Nov 20, 2019

The HTTP/1.1 version works well because the (small) writes are never stalled and all happen in different connections.

For HTTP/2, the concurrency makes it so a request trying to write the response content is stalled because other threads are currently writing to the single connection that HTTP/2 uses.
Because the write is non-blocking, it queues the buffer to write and return immediately, allowing the code that calls AsyncContext.complete() to run before the write is finished.

@kptfh
Copy link
Author

kptfh commented Nov 20, 2019

Got it. Thanks

@sbordet
Copy link
Member

sbordet commented Nov 20, 2019

@kptfh are you going to raise an issue to the Spring project?

@kptfh
Copy link
Author

kptfh commented Nov 21, 2019

@sbordet here it is issue
Please, check it and comment.

@sbordet sbordet closed this as completed Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants