Skip to content

Commit

Permalink
bugfix: risk condition in workers
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Sep 14, 2012
1 parent df43147 commit 9636cca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dpark/rdd.py
Expand Up @@ -108,7 +108,8 @@ def snapshot(self, path=None):
ident = '%d_%x' % (self.id, hash(str(self)))
path = os.path.join(path, ident)
if not os.path.exists(path):
os.makedirs(path)
try: os.makedirs(path)
except OSError: pass
self.snapshot_path = path
return self

Expand Down
3 changes: 2 additions & 1 deletion dpark/shuffle.py
Expand Up @@ -38,7 +38,8 @@ def initialize(cls, isMaster):
def getOutputFile(cls, shuffleId, inputId, outputId):
path = os.path.join(cls.shuffleDir, str(shuffleId), str(inputId))
if not os.path.exists(path):
os.makedirs(path)
try: os.makedirs(path)
except OSError: pass
return os.path.join(path, str(outputId))

@classmethod
Expand Down

0 comments on commit 9636cca

Please sign in to comment.