Merge "Revert "Fixes race condition with privsep utime""
This commit is contained in:
commit
9fa26e439b
@ -70,10 +70,12 @@ def chmod(path, mode):
|
|||||||
def utime(path):
|
def utime(path):
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
raise exception.FileNotFound(file_path=path)
|
raise exception.FileNotFound(file_path=path)
|
||||||
# context wrapper ensures the file exists before trying to modify time
|
|
||||||
# which fixes a race condition with NFS image caching (see LP#1809123)
|
# NOTE(mikal): the old version of this used execute(touch, ...), which
|
||||||
with open(path, 'a'):
|
# would apparently fail on shared storage when multiple instances were
|
||||||
os.utime(path, None)
|
# being launched at the same time. If we see failures here, we might need
|
||||||
|
# to wrap this in a try / except.
|
||||||
|
os.utime(path, None)
|
||||||
|
|
||||||
|
|
||||||
@nova.privsep.sys_admin_pctxt.entrypoint
|
@nova.privsep.sys_admin_pctxt.entrypoint
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
fixes:
|
|
||||||
- |
|
|
||||||
Fixes a race condition when multiple instances are launched at the same
|
|
||||||
time, which leads to a failure when modifying the modified time of the
|
|
||||||
instance base image. This issue was noticed when using an NFS backend. For
|
|
||||||
more information see https://bugs.launchpad.net/nova/+bug/1809123
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user