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
concurrency issue / race condition #975
Comments
I did more investigation today and can quite confidently say that the problem is caused by the LRUCache used for the paths. It's not really the cache which is at fault but CompiledPath which has volatile state. When the cache value is reused between threads it means you have the same CompiledPath but also the same FunctionPathToken which contains the parameters that holds the state of the current evaluation. You cannot share this between threads. The issue is resolved when cache is turned off (with NOOPCache). |
Seems related to #974 🤔 |
@Darkvater How about replacing the Cache with one backing by guava/caffeine? |
The problem is not with the caching library but the way it is used. No other cache engine can help here, the problem is a lot deeper. |
Hi,
I've been investigating strange behaviour in wiremock (see wiremock/wiremock#706 (comment)) and over the course of several days narrowed the issue down to a race condition in json-path. While I am still trying to pin down the exact culprit please find my findings below. Maybe someone with intimate knowledge of the library can see immediately what is wrong which would save me a lot of time.
JsonPath.read(<<json>>, "concat($.keys())")
returns the keys from a json called in a different threadlog and explanation
[<thread-id> - <class-instance-hash>] <class-name>::<method> ... parameters of interest]
<<BODY>>
it means the same JSON payload; everywhere you see<<CONFIG>>
it is the same object instance.$.keys
and thenconcat()
$.keys
to "transactionId-ZFOr/PRIIPS" the result of EvaluationContext::addResult onconcat()
is suddenly "transactionId-ZFOr/MIFID" which is another call. You can see this between the section highlighted in -----EVALUATIONCONTEXTIMPL::addResult-1
is on callingaddResult
methodEVALUATIONCONTEXTIMPL::addResult-2
is after adding valueResult inaddResult
EVALUATIONCONTEXTIMPL::addResult-3
is after adding pathResult inaddResult
notes
The text was updated successfully, but these errors were encountered: