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

Is AsynchCloseException intended behavior for handling unsolicited responses? #6259

Closed
djvanpelt opened this issue May 11, 2021 · 2 comments
Closed
Labels

Comments

@djvanpelt
Copy link

Jetty version
9.4.39

Java version
1.8

Question
Is it intended for handling of unsolicited responses 5152, to result in an AsynchronousCloseException?

About 1 in 10 requests my service makes with the client (to the same uri with the same content) are failing in this way. I jumped my jetty version from 9.2.x to 9.4.39 and am working through everything i've broken with that.

java.nio.channels.AsynchronousCloseExceptionjava.nio.channels.AsynchronousCloseException
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.close(HttpConnectionOverHTTP.java:189)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:354)
at org.eclipse.jetty.http.HttpParser.parseFields(HttpParser.java:1180)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1553)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:204)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:144)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:79)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:131)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:169)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036)
at java.lang.Thread.run(Thread.java:748)
            final InputStreamContentProvider content = new InputStreamContentProvider(inputStream);
            final InputStreamResponseListener modified = new InputStreamResponseListener();
            httpClient.setRequestBufferSize(requestBufferSize);
            httpClient.POST(serviceUri)
                    .idleTimeout(5, TimeUnit.MINUTES)
                    .send(modified);

            try (InputStream inputStream = modified.getInputStream()) {
                IOUtils.copyLarge(inputStream, response.getOutputStream());
            }
@sbordet
Copy link
Contributor

sbordet commented May 12, 2021

@djvanpelt the stack trace seems indeed an unsolicited response from the server. Do you have the server configured in this way?

Note that these are not "failures" in the sense that there is nothing to fail, so the stack trace should not pop up unless you are in DEBUG logging -- it's just the server that closes the connection.

In your snippet of code, you don't appear to use content.

@djvanpelt
Copy link
Author

I did not intentionally configure the server that way, but it was running jetty 9.2. After updating it to 9.4.39 I no longer saw AsynchronousCloseException in the client.

If it is supposed to be logged (and not thrown), then I am still puzzled what caused the exception including that trace. but I am no longer investigating. Thanks for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants