Skip to content

Fix race in lcow snapshot scratch.vhdx creation#2682

Merged
dmcgowan merged 1 commit intocontainerd:masterfrom
jterry75:lcow_snapshot_lock
Sep 25, 2018
Merged

Fix race in lcow snapshot scratch.vhdx creation#2682
dmcgowan merged 1 commit intocontainerd:masterfrom
jterry75:lcow_snapshot_lock

Conversation

@jterry75
Copy link
Copy Markdown
Contributor

Signed-off-by: Justin Terry (VM) [email protected]

@jterry75
Copy link
Copy Markdown
Contributor Author

@crosbymichael @dmcgowan - Since the snapshotter runs in proc there is no need for a file lock. The issue here was that if the creation fails after the lock was taken the lock file was leaked to the file system. Once the lock file was present because of opening with flags os.O_EXCL|os.O_CREATE we were never able to obtain the lock again and would time out on 2nd->Nth retries.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Sep 25, 2018

Codecov Report

Merging #2682 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2682   +/-   ##
======================================
  Coverage      45%     45%           
======================================
  Files          92      92           
  Lines       10114   10114           
======================================
  Hits         4552    4552           
  Misses       4842    4842           
  Partials      720     720
Flag Coverage Δ
#linux 48.72% <ø> (-0.03%) ⬇️
#windows 41.76% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bc4ba2...e373126. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

@dmcgowan
Copy link
Copy Markdown
Member

LGTM

Since this is running inside of a transaction context there should already be a file level lock on the bolt database.

@dmcgowan dmcgowan merged commit 4b1d56e into containerd:master Sep 25, 2018
@dmcgowan dmcgowan added this to the 1.2 milestone Sep 25, 2018
@jterry75 jterry75 deleted the lcow_snapshot_lock branch September 25, 2018 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants