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

HTTP Cache is broken when using "Retrieve all embedded resources" with concurrent pool #2523

Closed
asfimport opened this issue Sep 1, 2011 · 4 comments

Comments

@asfimport
Copy link
Collaborator

shmulikk (Bug 51752):
HTTP Cache is working fine for HTTP Request Sampler and for all of the embedded resources.
When enabling concurrent thread pool for "Retrieve all embedded resources" the requests are being sent without the relevant cache headers.

Probably got to do with the cache info being saved on the requesting thread which probably exits after getting all embedded resources (this is occurring also with only one thread in the concurrent thread pool).

This happens with any HttpClient or JAVAImpl.

Severity: normal
OS: All

Blocks:

@asfimport
Copy link
Collaborator Author

shmulikk (migrated from Bugzilla):
Caused by current implementation of CacheManager, which using ThreadLocal to separate Cache for each thread(virtual user).

This is causing to separate the Cache to each thread in the concurrent pool, thus breaking the cache.

Currently in CacheManager.java:
private transient ThreadLocal<Map<String, CacheEntry>> threadCache;

Suggested solution:
Removing ThreadLocal from the code.
Changing the key to include the url (current key) + ThreadName.

@asfimport
Copy link
Collaborator Author

@milamberspace (migrated from Bugzilla):
Good catch. Thanks for report.
Fixed with InheritableThreadLocal (concurrent threads pool are chlidren of main http request/virtual user)

URL: http://svn.apache.org/viewvc?rev=1166165&view=rev
Log:
#2523 - HTTP Cache is broken when using "Retrieve all embedded resources" with concurrent pool

Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
jakarta/jmeter/trunk/xdocs/changes.xml

@asfimport
Copy link
Collaborator Author

@milamberspace (migrated from Bugzilla):
Not good. Don't works with several loops (works only on same loop for same embebbed resources)

Need some additionnal works

@asfimport
Copy link
Collaborator Author

@milamberspace (migrated from Bugzilla):
Oups !!!
Works with loops, I forget to unchecked "Clear cache each iteration?" on HTTP Cache manager on my test plan.

Sorry from SPAM.

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

No branches or pull requests

1 participant