Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Scripting HTL Engine 1.4.24-1.4.0
-
None
Description
With caching enabled, under concurrency the ScriptDependencyResolver.resolve can return null values.
Context: Github
- Multiple threads are trying to resolve the same scriptIdentifier
- They all proceed to line 133 because the resolutionCache is not yet populated.
- One thread gets the writeLock, resolves the result, stores it back into the resolutionCache, and eventually releases the write lock.
- now all the other threads waiting on line 133 lock on the writelock one-by-one; and when checking the resolutionCache on line 136, the resolutionCache is already populated; and then they just release the writelock and proceed. But during this time result is never read from the resolutionCache, so it's still null and returned as such.
This normally happens immediately after startup, when the resolutionCache is still empty.
Attachments
Issue Links
- links to