Closed TruffleMuffin closed 10 years ago
After investigation, it seems this situation is not occurring naturally via the use of Async. I have added a test set that should emulate the problem however it does not fail currently.
After executing this test with other code it is now happening. Will investigate further to resolve.
Looks like an issue with the testing environment rather than code. now rectified.
Consider the scenario where a number of Policies require the same EnvironmentDetails. Each makes a request to the EnvrionmentService for those details. Conceivably, because these requests are handled in parallel many requests would be executed simultaneously, this means that if the Environment takes a long time to respond then it will only be compounded in this scenario.
Please add a composition layer that can be optionally turned on that will issue locks for each environment alias, preventing non cached hits from execution in parallel. This creates a short term block but then allows the details to be retrieved quickly from the cache once the block is released.