Bug 54449 - HTTPS requests using HC4 hang for 4-5 seconds when using IP's without reverse DNS under Windows
Summary: HTTPS requests using HC4 hang for 4-5 seconds when using IP's without reverse...
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.8
Hardware: PC Windows XP
: P3 minor with 2 votes (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-18 15:13 UTC by Troels Liebe Bentsen
Modified: 2016-09-27 08:57 UTC (History)
1 user (show)



Attachments
Jmeter plan that shows the issue (4.61 KB, text/plain)
2013-01-18 15:13 UTC, Troels Liebe Bentsen
Details
Jmeter file for Mac OS x attached (4.03 KB, application/octet-stream)
2013-04-04 21:20 UTC, Hitesh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Troels Liebe Bentsen 2013-01-18 15:13:58 UTC
Created attachment 29866 [details]
Jmeter plan that shows the issue

When using HTTPClient4 with HTTPS, requests hangs for 4-5 seconds for each request when using IP's without reverse DNS, using the DNS names or adding the IP and DNS name to hosts file removes the delay. Also using HTTPClient3.1 instead seems to solve the issue.

I have added a plan that shows the issue.

Regards Troels
Comment 1 Troels Liebe Bentsen 2013-01-18 16:50:40 UTC
Should note that this is on Windows 8
Comment 2 Sebb 2013-01-18 17:00:04 UTC
Here is a stack dump during the pause:

"Thread Group 1-1" prio=6 tid=0x038f3c00 nid=0xd80 runnable [0x03b7f000]
   java.lang.Thread.State: RUNNABLE
        at java.net.Inet4AddressImpl.getHostByAddr(Native Method)
        at java.net.InetAddress$1.getHostByAddr(Unknown Source)
        at java.net.InetAddress.getHostFromNameService(Unknown Source)
        at java.net.InetAddress.getHostName(Unknown Source)
        at java.net.InetAddress.getHostName(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.getHost(Unknown Source)
        - locked <0x1349be48> (a sun.security.ssl.SSLSocketImpl)
        at sun.security.ssl.Handshaker.getHostSE(Unknown Source)
        at sun.security.ssl.ClientHandshaker.getKickstartMessage(Unknown Source)
        at sun.security.ssl.Handshaker.kickstart(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.kickstartHandshake(Unknown Source)
        - locked <0x1349be48> (a sun.security.ssl.SSLSocketImpl)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        - locked <0x1349c038> (a java.lang.Object)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.getSession(Unknown Source)
        at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:91)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
        at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:284)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
        at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
        at java.lang.Thread.run(Unknown Source)

This will need further investigation.
Comment 3 Sebb 2013-01-18 17:01:09 UTC
The stack dump was on WinXP using JMeter 2.8.
Comment 4 Philippe Mouawad 2013-01-18 17:04:30 UTC
Hello,
What java version are you using ?


Regards
Comment 5 Troels Liebe Bentsen 2013-01-18 17:11:44 UTC
C:\Users\TroelsLiebeBentsen>java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
Comment 6 Sebb 2013-01-18 17:27:53 UTC
(In reply to comment #3)
> The stack dump was on WinXP using JMeter 2.8.

2013/01/18 16:55:19 INFO  - jmeter.JMeter: Version 2.8 r1393162 
2013/01/18 16:55:19 INFO  - jmeter.JMeter: java.version=1.7.0_11 
2013/01/18 16:55:19 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM
Comment 7 Sebb 2013-01-18 17:29:12 UTC
Using:

2013/01/18 17:25:52 INFO  - jmeter.JMeter: Version 2.8 r1393162 
2013/01/18 17:25:52 INFO  - jmeter.JMeter: java.version=1.6.0_38 
2013/01/18 17:25:52 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM 
2013/01/18 17:25:52 INFO  - jmeter.JMeter: os.name=Windows XP 

I get similar results:

"Thread Group 1-1" prio=6 tid=0x03c4c400 nid=0x27c runnable [0x055ff000]
   java.lang.Thread.State: RUNNABLE
        at java.net.Inet4AddressImpl.getHostByAddr(Native Method)
        at java.net.InetAddress$1.getHostByAddr(InetAddress.java:852)
        at java.net.InetAddress.getHostFromNameService(InetAddress.java:532)
        at java.net.InetAddress.getHostName(InetAddress.java:475)
        at java.net.InetAddress.getHostName(InetAddress.java:447)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getHost(SSLSocketImpl.java:1971)
        - locked <0x1302b5b8> (a com.sun.net.ssl.internal.ssl.SSLSocketImpl)
        at com.sun.net.ssl.internal.ssl.Handshaker.getHostSE(Handshaker.java:257)
        at com.sun.net.ssl.internal.ssl.ClientHandshaker.getKickstartMessage(ClientHandshaker.java:1020)
        at com.sun.net.ssl.internal.ssl.Handshaker.kickstart(Handshaker.java:620)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1305)
        - locked <0x1302b5b8> (a com.sun.net.ssl.internal.ssl.SSLSocketImpl)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1202)
        - locked <0x1302b718> (a java.lang.Object)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1230)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getSession(SSLSocketImpl.java:2036)
        at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:91)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
        at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:284)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
        at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
        at java.lang.Thread.run(Thread.java:662)
Comment 8 Philippe Mouawad 2013-01-18 17:50:15 UTC
I don't reproduce on Mac OSx:
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-10M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

@sebb do you use the plan as is or do you point 

@Troels Liebe Bentsen Is the IP in the test plan public ?

Thanks
Comment 9 Sebb 2013-01-18 17:56:36 UTC
(In reply to comment #8)
> I don't reproduce on Mac OSx:
> java version "1.6.0_37"
> Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-10M3909)
> Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
> 
> @sebb do you use the plan as is or do you point 

Yes (except I unchecked "Follow redirects" - not relevant here)

> @Troels Liebe Bentsen Is the IP in the test plan public ?
>
> Thanks
Comment 10 Philippe Mouawad 2013-01-20 21:13:55 UTC
I reproduce on Windows 7  but not on Mac OS.
Seems to affect Windows Family only.

Could be something related to this:
http://www.velocityreviews.com/forums/showpost.php?p=2959030&postcount=8
Comment 11 Sebb 2013-01-20 23:43:45 UTC
However the problem only affects HC4, not the HC3.1 or Java implementations.

So if it is a Windows issue, why is it being triggered by HC4 only?

I think it may be something to do with the way SSL verification is handled in HC4.
Even though we use the HC4TrustAllSSLSocketFactory, it still invokes org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:91) which calls getSession, even though the session is not needed later.

I've not yet had a chance to try recoding to avoid this; if it is the cause then I think we may need to raise an enhancement request against HC4.
Comment 12 Philippe Mouawad 2013-01-21 06:10:16 UTC
I thought that:

- https://issues.apache.org/jira/browse/HTTPCLIENT-1302
Comment 13 Hitesh 2013-04-04 21:20:20 UTC
Created attachment 30151 [details]
Jmeter file for Mac OS x attached
Comment 14 Sebb 2013-04-05 00:24:49 UTC
(In reply to comment #13)
> Created attachment 30151 [details]
> Jmeter file for Mac OS x attached

Seems to be for a different bug report. Was this intended for Bugzilla 54799 ?
Comment 15 Philippe Mouawad 2013-04-05 05:40:40 UTC
Yes it's related to 54799
Comment 16 Dzmitry Kashlach 2014-07-18 12:28:06 UTC
Failed to reproduce on Xubuntu 12.04
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)
Comment 17 Philippe Mouawad 2014-08-18 19:53:31 UTC
Could this be an explanation:

- http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6450279
Comment 18 Philippe Mouawad 2016-09-27 08:57:44 UTC
Anybody could test this bug on Windows again to see if it's still in 3.0 or current nightly ?
Thanks