-
Notifications
You must be signed in to change notification settings - Fork 70
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
Async servlet failed to send large data frames completely when HTTP/2 trailers are present #2016
Comments
Hi @dapengzhang0, After an initial investigation, I just wanted to clarify my understanding of the problem and make sure we're on the same wavelength! The total data bytes received before a closed connection seem to mostly be one of three values: Kind regards, Matt |
@MattGill98 Thanks you very much for the investigation. I actually don't know what is really happening under the hood. I'm just experiencing data corruption when the Servlet on Glassfish sends large data followed by trailers. This is observed with Netty client as well as nghttp client. If there are no trailers, or the trailers are sent a bit later after the payload like with a 100 ms delay, then the data that the client receives will not be corrupted. |
Hi @dapengzhang0, No worries at all, that's fine! I'm fairly sure I know where it's coming from. I'll let you know when I get any further! Kind regards, Matt |
Hi @dapengzhang0, A pull request for a potential fix has been made here: payara#13. Once it's been verified and merged to Payara, we can work on making an upstream PR. Kind regards, Matt |
The fix has been merged to Payara. Can it be ported back upstream here now? |
…implementations - default is none (uses JDK's impl) - profile npn uses grizzly-npn-bootstrap - profile openjsse uses openjsse - versions can be overriden from command line (to compare results) Signed-off-by: David Matejcek <dmatej@seznam.cz>
- important loggers are explicitly named in logging.properties Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: David Matejcek <dmatej@seznam.cz>
Create new phase in the handshake listener to allow registration of the custom ALPN logic. This allows the HTTP/2 filter to work correctly. Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matejcek <dmatej@seznam.cz>
Streams still allowed pushing resources when globally disabled as the stream itself and the session both allow it. This change makes the stream also respect the global configuration. Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matejcek <dmatej@seznam.cz>
…nterface - moving this interface out is a breaking change Signed-off-by: David Matejcek <dmatej@seznam.cz>
…y connection closure. Signed-off-by: Matt Gill <matthew.gill@live.co.uk> Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: Matt Gill <matthew.gill@live.co.uk> Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: Matt Gill <matthew.gill@live.co.uk> Signed-off-by: David Matejcek <dmatej@seznam.cz>
- partial cleanup, but requires much more than this - DefaultOutputSink - combination of "fixes by refactoring" mixed with the changes in the flow of the logic - sendTrailers now locks the deflater - added some javadocs and much more logs Signed-off-by: David Matejcek <dmatej@seznam.cz>
- can run with any compatible implementation, not only NPN Bootstrap - with new JDK versions after 8u250 uses it's JSSE impl by default - still can use older NPN bootstrap versions if configured - can use also other implementations (openjsse) Signed-off-by: David Matejcek <dmatej@seznam.cz>
…mes, but ... - in this state grizzly: - fails TrailersTest (grizzly-http2; race condition, passes if I use stepping) - passes TCK tests with Payara (websocket) - still fails h2spec with Payara (race condition, different, but related issue) Signed-off-by: David Matejcek <dmatej@seznam.cz>
- 19001 is often occupied in Kubuntu Signed-off-by: David Matejcek <dmatej@seznam.cz>
- if the queue size is not same as reserved space, and if it is last content and the content is a trailer, send trailers - if the queue size is same as reserved space, and record was already processed, don't send trailers. - TrailersTest - just formatting and finals Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matejcek <dmatej@seznam.cz>
- original code was throwing NPE - handler can be null - then we have nothing to handle the reason - closeReason can be null - then we use "locally closed" as a default (may be incorrect) - even ignored exception should be visible somewhere (logging) Signed-off-by: David Matejcek <dmatej@seznam.cz>
- based on h2spec results - client was able to cause ISE on the server simply by misformatted header - assertions are worthless in production Signed-off-by: David Matejcek <dmatej@seznam.cz>
- fixes another NPE seen in logs Signed-off-by: David Matejcek <dmatej@seznam.cz>
Signed-off-by: David Matejcek <dmatej@seznam.cz>
…implementations - default is none (uses JDK's impl) - profile npn uses grizzly-npn-bootstrap - profile openjsse uses openjsse - versions can be overriden from command line (to compare results) Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
- original code was throwing NPE - handler can be null - then we have nothing to handle the reason - closeReason can be null - then we use "locally closed" as a default (may be incorrect) - even ignored exception should be visible somewhere (logging) Signed-off-by: David Matějček <dmatej@seznam.cz>
- based on h2spec results - client was able to cause ISE on the server simply by misformatted header - assertions are worthless in production Signed-off-by: David Matějček <dmatej@seznam.cz>
- fixes another NPE seen in logs Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: David Matějček <dmatej@seznam.cz>
…implementations - default is none (uses JDK's impl) - profile npn uses grizzly-npn-bootstrap - profile openjsse uses openjsse - versions can be overriden from command line (to compare results) Signed-off-by: David Matějček <dmatej@seznam.cz>
- important loggers are explicitly named in logging.properties Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: David Matějček <dmatej@seznam.cz>
Create new phase in the handshake listener to allow registration of the custom ALPN logic. This allows the HTTP/2 filter to work correctly. Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
Streams still allowed pushing resources when globally disabled as the stream itself and the session both allow it. This change makes the stream also respect the global configuration. Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
…nterface - moving this interface out is a breaking change Signed-off-by: David Matějček <dmatej@seznam.cz>
…y connection closure. Signed-off-by: Matt Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: Matt Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: Matt Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
- partial cleanup, but requires much more than this - DefaultOutputSink - combination of "fixes by refactoring" mixed with the changes in the flow of the logic - sendTrailers now locks the deflater - added some javadocs and much more logs Signed-off-by: David Matějček <dmatej@seznam.cz>
- can run with any compatible implementation, not only NPN Bootstrap - with new JDK versions after 8u250 uses it's JSSE impl by default - still can use older NPN bootstrap versions if configured - can use also other implementations (openjsse) Signed-off-by: David Matějček <dmatej@seznam.cz>
…mes, but ... - in this state grizzly: - fails TrailersTest (grizzly-http2; race condition, passes if I use stepping) - passes TCK tests with Payara (websocket) - still fails h2spec with Payara (race condition, different, but related issue) Signed-off-by: David Matějček <dmatej@seznam.cz>
- 19001 is often occupied in Kubuntu Signed-off-by: David Matějček <dmatej@seznam.cz>
- if the queue size is not same as reserved space, and if it is last content and the content is a trailer, send trailers - if the queue size is same as reserved space, and record was already processed, don't send trailers. - TrailersTest - just formatting and finals Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: Matthew Gill <matthew.gill@live.co.uk> Signed-off-by: David Matějček <dmatej@seznam.cz>
- original code was throwing NPE - handler can be null - then we have nothing to handle the reason - closeReason can be null - then we use "locally closed" as a default (may be incorrect) - even ignored exception should be visible somewhere (logging) Signed-off-by: David Matějček <dmatej@seznam.cz>
- based on h2spec results - client was able to cause ISE on the server simply by misformatted header - assertions are worthless in production Signed-off-by: David Matějček <dmatej@seznam.cz>
- fixes another NPE seen in logs Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: David Matějček <dmatej@seznam.cz>
- Test results: - OpenJDK 8u275, openjsse 1.1.5 ... SUCCESS - OpenJDK 11.0.8, openjsse 1.1.5 ... FAIL ... as expected - OpenJDK 8u275, npn bootstrap 1.9 ... FAIL ... as expected - OpenJDK 8u232, npn bootstrap 1.9.payara-p1 ... SUCCESS - OpenJDK 8u275 ... SUCCESS - OpenJDK 11.0.8 ... SUCCESS Signed-off-by: David Matějček <dmatej@seznam.cz>
Signed-off-by: David Matejcek <dmatej@seznam.cz>
I tried to let a async servlet send out a sequence of large data (40k each) followed by trailers. The client does receive the trailer, but only receives partial data.
Thread.sleep
for 100ms (the shorter the time is, the more flaky the result will be) beforeasyncContext.complete()
Steps to reproduce:
Console output:
Only
105535
bytes were received, expecting120000
bytes to be received.If you try multiple times, occasionally the client can receive all the
120000
bytes, but it's rare.The text was updated successfully, but these errors were encountered: