Fix race in os sandbox sharing#728
Conversation
|
@mrjana thanks. pls correct me if am wrong. the sharing of OSL sandbox happens only for So my question is, is the current fix complete without also protecting the delete side ? BTW, I tried the patch to see if it solves moby/moby#17577, but it didnt. But when I added a small hack as follows, then I dont see the issue anymore. So, I think we should either synchronize the creation and deletion of the OSL sandbox. Or prevent destroying the osl sandbox for |
|
@mavenugo I did test for moby/moby#17577 and it did work for me. But you brought up a good point while the sandbox is being destroyed. Let me refactor this code to just create it once and use it everywhere and never destroy it. |
|
@mrjana thanks |
There is a race in os sandbox sharing code where two containers which are sharing the os sandbox try to recreate the os sandbox again which might result in destroying the os sandbox and recreating it. Since the os sandbox sharing is happening only for default sandbox, refactored the code to create os sandbox only once inside a `sync.Once` api so that it happens exactly once and gets reused by other containers. Also disabled deleting this os sandbox. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
|
@mavenugo Updated new diffs. PTAL |
|
LGTM. |
Fix race in os sandbox sharing
There is a race in os sandbox sharing code where two containers which
are sharing the os sandbox try to recreate the os sandbox again which
might result in destroying the os sandbox and recreating it. Since the
os sandbox sharing is happening only for default sandbox, refactored the
code to create os sandbox only once inside a
sync.Onceapi so that ithappens exactly once and gets reused by other containers. Also disabled
deleting this os sandbox.
Fixes moby/moby#17577
Signed-off-by: Jana Radhakrishnan mrjana@docker.com