We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8363afe commit 5733cc8Copy full SHA for 5733cc8
1 file changed
sdks/python/apache_beam/io/gcp/bigquery_file_loads.py
@@ -134,7 +134,13 @@ def _make_new_file_writer(
134
directory = fs.FileSystems.join(file_prefix, destination)
135
136
if not fs.FileSystems.exists(directory):
137
- fs.FileSystems.mkdirs(directory)
+ try:
138
+ fs.FileSystems.mkdirs(directory)
139
+ except IOError:
140
+ # Concurrent workers may race to create the same directory.
141
+ # Ignore the IOError if another worker successfully created it.
142
+ if not fs.FileSystems.exists(directory):
143
+ raise
144
145
file_name = str(uuid.uuid4())
146
file_path = fs.FileSystems.join(file_prefix, destination, file_name)
0 commit comments