Bug 52310 - variable in IPSource failed HTTP request if "Concurrent Pool Size" is enabled
Summary: variable in IPSource failed HTTP request if "Concurrent Pool Size" is enabled
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.5.1
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 11:19 UTC by patches
Modified: 2011-12-10 12:43 UTC (History)
2 users (show)



Attachments
Test plan to reproduce the issue (5.49 KB, application/octet-stream)
2011-12-09 11:19 UTC, patches
Details

Note You need to log in before you can comment on or make changes to this bug.
Description patches 2011-12-09 11:19:00 UTC
Created attachment 28057 [details]
Test plan to reproduce the issue

My test plan using IP aliasing.

If a http request use "Embedded Ressources" and "Concurrent Pool Size" with IP Source defined as a variable, the sample failed with the following stack : 

java.net.UnknownHostException: ${IP_ADDR}
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
        at java.net.InetAddress.getAddressFromNameService(InetAddress.java:
1200)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
        at java.net.InetAddress.getAllByName(InetAddress.java:1083)
        at java.net.InetAddress.getAllByName(InetAddress.java:1019)
        at java.net.InetAddress.getByName(InetAddress.java:969)
        at
org.apache.jmeter.protocol.http.sampler.HTTPHC3Impl.setupConnection(HTTPHC3Impl.java:
419)
        at
org.apache.jmeter.protocol.http.sampler.HTTPHC3Impl.sample(HTTPHC3Impl.java:
237)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:
62)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
$ASyncSample.call(HTTPSamplerBase.java:1708)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
$ASyncSample.call(HTTPSamplerBase.java:1693)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Comment 1 Philippe Mouawad 2011-12-09 21:06:59 UTC
Also on trunk
Comment 2 Philippe Mouawad 2011-12-09 21:44:31 UTC
The issue is due to the fact the property is cached in JMeterContext which is  thread local in Parent thread of Parallel Download threads.
Quick fix would be to make ThreadLocal InheritableThreadLocal but as JMeterContext is not thread-safe it is not the right fix.

Could Making JMeterContext cloneable a solution ? otherwise implement what sebb proposed on dev list to notify Executor threads of start/end.
Comment 3 Sebb 2011-12-10 01:00:19 UTC
(In reply to comment #2)
> The issue is due to the fact the property is cached in JMeterContext which is 
> thread local in Parent thread of Parallel Download threads.
> Quick fix would be to make ThreadLocal InheritableThreadLocal but as
> JMeterContext is not thread-safe it is not the right fix.

If the context is not mutated, then it should be OK to share.
Comment 4 Philippe Mouawad 2011-12-10 10:41:45 UTC
Date: Sat Dec 10 10:40:18 2011
New Revision: 1212764

URL: http://svn.apache.org/viewvc?rev=1212764&view=rev
Log:
Bug 52310 - variable in IPSource failed HTTP request if "Concurrent Pool Size" is enabled

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java
   jmeter/trunk/xdocs/changes.xml
Comment 5 Philippe Mouawad 2011-12-10 12:43:42 UTC
Date: Sat Dec 10 12:06:23 2011
New Revision: 1212778

URL: http://svn.apache.org/viewvc?rev=1212778&view=rev
Log:
Bug 52310 - variable in IPSource failed HTTP request if "Concurrent Pool Size" is enabled
ROLLBACK

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java

Date: Sat Dec 10 12:09:18 2011
New Revision: 1212779

URL: http://svn.apache.org/viewvc?rev=1212779&view=rev
Log:
Bug 52310 - variable in IPSource failed HTTP request if "Concurrent Pool Size" is enabled
ROLLBACK (Oups one modification passed)

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java

Log:
Bug 52310 - variable in IPSource failed HTTP request if "Concurrent Pool Size" is enabled
Fix by making child get context of the parent.

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Comment 6 The ASF infrastructure team 2022-09-24 20:37:48 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2676