Summary: | HTTP client fails to close connection if server misbehaves by not sending "connection: close", violating HTTP RFC 2616 / RFC 7230 | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Paul Millar <paul.millar> |
Component: | HTTP | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | p.mouawad |
Priority: | P2 | ||
Version: | 2.13 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 57319 | ||
Bug Blocks: | |||
Attachments: | The JMeter configuration + wireshark capture of network traffic |
Description
Paul Millar
2015-11-04 17:14:00 UTC
Hello, Could you test with nightly build and check what's happening now ? See Bug 57921 Thanks Tested with latest nightly build (r1710693) and the problem persists. From its description, bug 57921 is unrelated: that bug refers to a problem when "Keep Alive" enabled. This bug is about a problem with "Keep Alive" switched off. Supporting the OPs request: RFC 7230 also says: 6.6. Tear-down ... A client that sends a "close" connection option MUST NOT send further requests on that connection (after the one containing "close") and MUST close the connection after reading the final response message corresponding to this request. In this case here, the the requests to the first and the second server contains the client side "Connection: close", but only the first server responds with "Connection: close". The second does not, but both close the connection. Although it is not nice from the second server to not send "Connection: close", it is allowed (same RFC section: "The server SHOULD send a "close" connection option in its final response on that connection."). Looking at HTTPHC3Impl and HTTPHC4Impl it really seems we only set the "Connection: close" header but don't tell the HTTP clent to actually close the connection. I didn't check for the Java impl. So there really seems to be a bug here. You're quite correct in noting that the second server failed to send the "Connection: close" header in the response. Independent of this problem, that should be fixed. Hi, Isn't this issue: https://issues.apache.org/jira/browse/HTTPCLIENT-1655 @Paul Millar, we upgraded today to HC4.5.1. Could you try nightly build tomorrow and give us some feedback ? Thanks (In reply to Philippe Mouawad from comment #5) > Hi, > Isn't this issue: > https://issues.apache.org/jira/browse/HTTPCLIENT-1655 > > @Paul Millar, we upgraded today to HC4.5.1. > Could you try nightly build tomorrow and give us some feedback ? > Thanks Forget my last comment. I misunderstood the problem. Now let me recap what I understand: The issue is due to server not setting header "Connection: close", and JMeter as a side effect not closing the connection while it should . Is my understanding correct ? Thanks Yes, that was my impression when I looked at the ticket. I wrote "Looking at HTTPHC3Impl and HTTPHC4Impl it really seems we only set the "Connection: close" header but don't tell the HTTP clent to actually close the connection. I didn't check for the Java impl." If the *server* sends "Connection: close", then the client will automatically close the ocnnection, but only sending a "Connection: close" from the client side does not lead to automaticaly closing it in the client. IMHO we have to tell the client not only to send "Connection: close" but also to close the connection. Most servers do send "Connection: close" so often the problem doesn't occur. Hi, It appears it was an issue in HTTPCORE: https://issues.apache.org/jira/browse/HTTPCORE-397 Could you please test nightly build and report wether issue is fixed for you ? Thanks Hi, New update , fix is not in HTTPcore-4.4.4 so no need to test. Regards Philippe Fix should be available in HTTPClient 4.5.2 as per commit: - https://github.com/ok2c/httpclient/commit/8f38a042494482e18f0129baf4f5118067acedde To have it in place, we will need to update HTTPHC4Impl to use the DefaultClientConnectionReuseStrategy.INSTANCE: ((AbstractHttpClient) httpClient).setReuseStrategy(DefaultClientConnectionReuseStrategy.INSTANCE); Author: pmouawad Date: Fri Feb 26 22:35:18 2016 New Revision: 1732569 URL: http://svn.apache.org/viewvc?rev=1732569&view=rev Log: Upgrade to HttpClient/httpmime 4.5.2 which fixes at the same time: - Bug 58881 - HTTP Request : HTTPHC4Impl shows exception when server uses "deflate" compression - Bug 58583 - HTTP client fails to close connection if server misbehaves by not sending "connection: close", violating HTTP RFC 2616 / RFC 7230 - Bug 56358 - Cookie manager supports cross port cookies and RFC6265 - Bug 57319 - Upgrade to HttpClient 4.5.2 Bugzilla Id: 57319 Modified: jmeter/trunk/build.properties jmeter/trunk/eclipse.classpath jmeter/trunk/lib/ (props changed) jmeter/trunk/lib/aareadme.txt jmeter/trunk/licenses/bin/README.txt jmeter/trunk/res/maven/ApacheJMeter_parent.pom jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestCookieManager.java jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java jmeter/trunk/xdocs/changes.xml Author: pmouawad Date: Fri Feb 26 22:50:37 2016 New Revision: 1732574 URL: http://svn.apache.org/viewvc?rev=1732574&view=rev Log: Bug 58950 - NoHttpResponseException when Pause between samplers exceeds keepalive sent by server Bugzilla Id: 58950 Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java jmeter/trunk/xdocs/changes.xml This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3688 |