Skip to content

Commit 0275086

Browse files
[Python] Fix race condition in requirements cache creation (#37042)
* Fix race condition in stager.py when starting multiple pipelines concurrently (fixes #36847) * remove race condition test
1 parent 585ad41 commit 0275086

File tree

1 file changed

+1
-1
lines changed
  • sdks/python/apache_beam/runners/portability

1 file changed

+1
-1
lines changed

sdks/python/apache_beam/runners/portability/stager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def create_job_resources(
218218
is None) else setup_options.requirements_cache)
219219
if (setup_options.requirements_cache != SKIP_REQUIREMENTS_CACHE and
220220
not os.path.exists(requirements_cache_path)):
221-
os.makedirs(requirements_cache_path)
221+
os.makedirs(requirements_cache_path, exist_ok=True)
222222

223223
# Stage a requirements file if present.
224224
if setup_options.requirements_file is not None:

0 commit comments

Comments
 (0)