Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] jetty client delivers incomplete response without exception?
  • From: "Robben, Bert" <Bert.Robben@xxxxxxxxxxxxx>
  • Date: Thu, 14 Apr 2022 15:47:24 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fisglobal.com; dmarc=pass action=none header.from=fisglobal.com; dkim=pass header.d=fisglobal.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OlTpzqJHiqRVXWnFnEavU/adCLfCXqTLb+l6b/Z6fkE=; b=hLttbSZPABpTETzQSEacPNSgN/V0OWUtqtsDjuA6ibK3tqyl6ifHTpNlEgelBE9m8FYz7b7Jff6QNRQueIILwbtwwQEy1Jsg2+nt1NVpdabMbAZt6L0doHC+eoBxpg/cZXau0PF1VQh/qXCWOzI3MzBt8jdkDz5Bbyvuu+4M9c1uG2pW2zsWXAd9vC7YyV2/OUimhh4mn/ry4ATUoTi4d+w5BuilgsGTmtUvck2sudbH1vv5bdXkIlfViJqai2pBNI4emJ1nX2ZzuQeGyZl81iJAtl4POhbj8RraweHMr2fnZqK9M5ex+jgIx3P23dHxs0vyrzZYxe9RNWknEvDJBg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NaaU5ORR70bDwtoCwTdLzoD9INOoRLixNYTx5fybNPA5w6ATY6IFZ3JgjCFHvzJ+3CWjiTPita4u7hpkFdEqCO1K1jiN1MNzSwFoFnv7Ydgmkz15rL0Gqg/IG3iRgbKZQEC12/Vu0K0tdFdLO3FJA6kkvK3PBCfB1PcbDyQO9wrNoE0AxH2alIVsI9LF3GKVO0KLOaQ4RT5xpF/xgcAHGzEeHBC1JXqmvtLzNvDPCgOb4k7tGGcXX5efDmzvNHBkpMohELvJ6pJ/s3HfXf1Wda0q0MivEVqUa9HiMfoHeDz55JLUmGaiVQPo5/Un/c8p7ZvTVovUGd+iEqBrhcuLmw==
  • Delivered-to: jetty-users@xxxxxxxxxxx
  • Disclaimersource: eop
  • List-archive: <https://www.eclipse.org/mailman/private/jetty-users/>
  • List-help: <mailto:jetty-users-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jetty-users>, <mailto:jetty-users-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdhQFhgH9tNRmK7WQoq4ltsCz18IGQ==
  • Thread-topic: jetty client delivers incomplete response without exception?

Hey,

 

I had a test failure (race condition, saw it only once) where a jetty client makes a request on a jetty server and only gets an incomplete response back. The jetty client does an asynchronous POST and consumes the response using an InputStreamResponseListener.

 

                try (InputStream inputStream = listener.getInputStream()) {

                    long dataReceived = 0;

                    byte[] buffer = new byte[…];

                    int read = inputStream.read(buffer);

                    while (read >= 0) {

                        dataReceived += read;

                        read = inputStream.read(buffer);

                    }

 

This loop ends without exceptions. However, the amount of data in the response (dataReceived) is > 0, but a lot smaller than expected which makes the test fail.

 

Important to know is that at the moment of this failure, the server was killed (as part of the test). Other requests that were ongoing get exceptions like the ones below. I understand and fully expect these exceptions. What I don’t understand is why the request that was consuming its response didn’t get any.

 

Is it wrong from me to assume I’ll always get some exception in case the server is killed?

 

I assume that our server-side resource is working as it should (so it completes when the entire response has been sent to the output); so this one doesn’t count.

 

Note that the server does NOT fill in the CONTENT_LENGTH of the response; as such the client doesn’t know when the stream will end. Is it possible that the client interprets closure of the response stream sometimes as “ok, this is the end” and doesn’t throw exceptions?

 

 

Here are some of the other exceptions from other (but different) requests:

 

[2022-04-12 03:09:49,154] [ERROR] [] [http-requests] [] - 1649732989067,87,GET,http://test-product:8080/test-product/v1/clustersingleton/clusterinfo/clusterInfoProvider?id=554d75d7-5c16-47e4-95e9-c0b110d1ec40-3484&replyAfter=110,EOFException,"HttpConnectionOverHTTP@48aa14a1::SocketChannelEndPoint@4c95996c{l=/10.233.90.85:35120,r=test-product/10.233.45.8:8080,ISHUT,fill=-,flush=-,to=85/29123}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@48aa14a1(l:/10.233.90.85:35120 <-> r:test-product/10.233.45.8:8080,closed=false)=>HttpChannelOverHTTP@9971e9a(exchange=HttpExchange@20c3f0a6{req=HttpRequest[GET /test-product/v1/clustersingleton/clusterinfo/clusterInfoProvider HTTP/1.1]@38d4f703[TERMINATED/null] res=HttpResponse[null 0 null]@586a478c[PENDING/null]})[send=HttpSenderOverHTTP@69b8e1d5(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@56417a84{s=START}],recv=HttpReceiverOverHTTP@4932f3a0(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]"

 

                                at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:376)

                                at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:181)

                                at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:131)

                                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.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)

                                at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1614)

 

and

 

                java.io.IOException: org.eclipse.jetty.io.EofException

                                at org.eclipse.jetty.client.util.OutputStreamContentProvider$DeferredOutputStream.flush(OutputStreamContentProvider.java:151)

                Caused by: java.io.IOException: Connection reset by peer

                                at sun.nio.ch.IOUtil.write(IOUtil.java:148)

 

This test failure was exceptional; I suspect some race condition on the server.

 

Note: I was using Jetty 9.4.43.v20210629 in this test. (I’ve now upgraded to 9.4.46)

 

Thanks,

 

Bert

The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.

Back to the top