Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid race condition between status monitoring and download tasks #532

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion servicex/query_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ async def get_signed_url(
# signing urls for a previous transform then we know it is complete as well
if cached_record or (
self.current_status
and self.current_status.status in DONE_STATUS
and (self.current_status.status in DONE_STATUS
and self.current_status.files_completed == len(files_seen))
):
break

Expand Down
4 changes: 2 additions & 2 deletions tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def test_download_files(python_dataset):
progress_mock = Mock()
python_dataset.minio_polling_interval = 0
python_dataset.minio = minio_mock
python_dataset.current_status = Mock(status="Complete")
python_dataset.current_status = Mock(status="Complete", files_completed=2)
python_dataset.configuration.shortened_downloaded_filename = False

result_uris = await python_dataset.download_files(
Expand All @@ -142,7 +142,7 @@ async def test_download_files_with_signed_urls(python_dataset):

python_dataset.minio_polling_interval = 0
python_dataset.minio = minio_mock
python_dataset.current_status = Mock(status="Complete")
python_dataset.current_status = Mock(status="Complete", files_completed=2)
python_dataset.configuration.shortened_downloaded_filename = False

result_uris = await python_dataset.download_files(
Expand Down
Loading