Skip to content

Commit

Permalink
telemetry: avoid race condition of dagit and daemon creating same dir (
Browse files Browse the repository at this point in the history
…#11652)

### Summary & Motivation

### How I Tested These Changes
  • Loading branch information
yuhan committed Jan 12, 2023
1 parent 8848f6e commit 64c1881
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python_modules/dagster/dagster/_core/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ def get_or_create_dir_from_dagster_home(target_dir):

dagster_home_logs_path = os.path.join(dagster_home_path, target_dir)
if not os.path.exists(dagster_home_logs_path):
os.makedirs(dagster_home_logs_path)
try:
os.makedirs(dagster_home_logs_path)
except FileExistsError:
# let FileExistsError pass to avoid race condition when multiple places on the same
# machine try to create this dir
pass
return dagster_home_logs_path


Expand Down

0 comments on commit 64c1881

Please sign in to comment.