Use volatile referneces to prevent double creation of Ryuk containers - #2929
Use volatile referneces to prevent double creation of Ryuk containers#2929aguibert wants to merge 1 commit into
Conversation
|
Ah, this would make sense. I wonder if @bsideup's #2882, which is also touching |
|
|
||
| @Synchronized | ||
| private DockerClientProviderStrategy getOrInitializeStrategy() { | ||
| private synchronized DockerClientProviderStrategy getOrInitializeStrategy() { |
There was a problem hiding this comment.
Already @Synchronized
| private synchronized DockerClientProviderStrategy getOrInitializeStrategy() { | |
| private DockerClientProviderStrategy getOrInitializeStrategy() { |
|
Since we synchronize our access to the fields, @aguibert do you think you can provide a reproducer (e.g. by starting multiple threads and triggering the resolve)? |
|
I can't easily create a reproducer for this -- it happens pretty intermittently. Thanks for pointing out the article, I did a bit more research on volatile vs. synchronized and realized that synchrnozed also synchronizes the thread memory and main memory for all variables, in addition to locking. Given that, I'll go ahead and close this PR as it will not fix the problem I was trying to solve |
|
@aguibert I will try to run it with JCStress then. Thanks for confirming that it is happening on your environment! At least we will be able to verify whether the fix worked or not :) |
|
@aguibert I am afraid it won't fix the double Ryuk issue, but I am currently trying to reproduce it, so that we can finally fix the problem (although without any luck so far :( ) |
I believe this fixes #2395
According to my logs for single-container usage, the docker client is being obtained twice: