Skip to content

#272 Fix race condition in DirectoryStore #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import zipfile
import shutil
import atexit
import errno
import re
import sys
import json
Expand Down Expand Up @@ -745,8 +746,9 @@ def __setitem__(self, key, value):
if not os.path.exists(dir_path):
try:
os.makedirs(dir_path)
except Exception:
raise KeyError(key)
except OSError as e:
if e.errno != errno.EEXIST:
raise KeyError(key)

# write to temporary file
temp_path = None
Expand Down
Binary file added zarr/tests/data/store.zip
Binary file not shown.
1 change: 1 addition & 0 deletions zarr/tests/data/store/foo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bar