Skip to content

Commit ee019d1

Browse files
committed
Increase the number of threads to 10 (default for S3) (#1423)
1 parent ae56209 commit ee019d1

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

api/python/quilt3/data_transfer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def create_s3_client():
4848

4949

5050
s3_transfer_config = TransferConfig()
51-
s3_threads = 4
5251

5352
# When uploading files at least this size, compare the ETags first and skip the upload if they're equal;
5453
# copy the remote file onto itself if the metadata changes.
@@ -277,7 +276,7 @@ def _copy_file_list_internal(s3_client, file_list):
277276
results = [None] * len(file_list)
278277

279278
with tqdm(desc="Copying", total=total_size, unit='B', unit_scale=True) as progress, \
280-
ThreadPoolExecutor(s3_threads) as executor:
279+
ThreadPoolExecutor(s3_transfer_config.max_request_concurrency) as executor:
281280

282281
def progress_callback(bytes_transferred):
283282
with lock:

api/python/tests/integration/test_packages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def test_load_into_quilt(self):
380380
new_pkg.set('foo2', test_file1)
381381

382382
with patch('time.time', return_value=1234567890), \
383-
patch('quilt3.data_transfer.s3_threads', 1):
383+
patch('quilt3.data_transfer.s3_transfer_config.max_request_concurrency', 1):
384384
remote_pkg = new_pkg.push('Quilt/package', 's3://my_test_bucket/')
385385

386386
# Modify one file, and check that only that file gets uploaded.
@@ -439,7 +439,7 @@ def test_load_into_quilt(self):
439439
remote_pkg.set('foo2', test_file3)
440440

441441
with patch('time.time', return_value=1234567891), \
442-
patch('quilt3.data_transfer.s3_threads', 1):
442+
patch('quilt3.data_transfer.s3_transfer_config.max_request_concurrency', 1):
443443
remote_pkg.push('Quilt/package', 's3://my_test_bucket/')
444444

445445

api/python/tests/test_data_transfer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def test_multi_upload(self):
199199
)
200200

201201
# stubber expects responses in order, so disable multi-threading.
202-
with mock.patch('quilt3.data_transfer.s3_threads', 1):
202+
with mock.patch('quilt3.data_transfer.s3_transfer_config.max_request_concurrency', 1):
203203
urls = data_transfer.copy_file_list([
204204
(path1.as_uri(), 's3://example1/foo.csv', path1.stat().st_size),
205205
(path2.as_uri(), 's3://example2/foo.txt', path2.stat().st_size),
@@ -360,7 +360,7 @@ def test_multipart_upload(self):
360360
}
361361
)
362362

363-
with mock.patch('quilt3.data_transfer.s3_threads', 1):
363+
with mock.patch('quilt3.data_transfer.s3_transfer_config.max_request_concurrency', 1):
364364
data_transfer.copy_file_list([
365365
(path.resolve().as_uri(), f's3://example/{name}', path.stat().st_size),
366366
])
@@ -429,7 +429,7 @@ def test_multipart_copy(self):
429429
}
430430
)
431431

432-
with mock.patch('quilt3.data_transfer.s3_threads', 1):
432+
with mock.patch('quilt3.data_transfer.s3_transfer_config.max_request_concurrency', 1):
433433
data_transfer.copy_file_list([
434434
('s3://example1/large_file1.npy', 's3://example2/large_file2.npy', size),
435435
])

0 commit comments

Comments
 (0)