From e65a5275eeecae6ab041db2f089ae5dc3eefd92c Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Tue, 5 Mar 2019 15:24:46 +0000 Subject: [PATCH] Revert "Fixes race condition with privsep utime" This reverts commit 525631d8dc058910728e55def616358b0e7f2f69. This change could potentially leave us with an empty file in the image cache, which would result in failure to spawn for any subsequent instance using the same image and image cache. This situation can only be recovered by manually deleting the file from the image cache. Until we can determine the root cause we should do something safer, like ignoring the utime failure. Change-Id: I55c072937d648d7840d01d31ed781bf93cfd94ab --- nova/privsep/path.py | 10 ++++++---- ...ix-image-utime-race-condition-3c404e272ea91b34.yaml | 8 -------- 2 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 releasenotes/notes/fix-image-utime-race-condition-3c404e272ea91b34.yaml diff --git a/nova/privsep/path.py b/nova/privsep/path.py index 680bce1751..c35e32ce54 100644 --- a/nova/privsep/path.py +++ b/nova/privsep/path.py @@ -70,10 +70,12 @@ def chmod(path, mode): def utime(path): if not os.path.exists(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) - with open(path, 'a'): - os.utime(path, None) + + # NOTE(mikal): the old version of this used execute(touch, ...), which + # would apparently fail on shared storage when multiple instances were + # 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 diff --git a/releasenotes/notes/fix-image-utime-race-condition-3c404e272ea91b34.yaml b/releasenotes/notes/fix-image-utime-race-condition-3c404e272ea91b34.yaml deleted file mode 100644 index 08aa6e4860..0000000000 --- a/releasenotes/notes/fix-image-utime-race-condition-3c404e272ea91b34.yaml +++ /dev/null @@ -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 -