Skip to content

Commit

Permalink
Merge pull request #5498 from joeldierkes/patch-5250-CLI___rucio_get_…
Browse files Browse the repository at this point in the history
…doesn_t_show_summary_anymore

Clients: Return information on download exception #5250
  • Loading branch information
bari12 committed May 12, 2022
2 parents 5a0079b + eaf7634 commit 00bf7e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rucio/client/downloadclient.py
Expand Up @@ -429,6 +429,8 @@ def _download_worker(self, input_queue, output_queue, trace_custom_fields, trace
except Exception as error:
logger(logging.ERROR, '%sFailed to download item' % log_prefix)
logger(logging.DEBUG, error)
item["clientState"] = "FAILED"
output_queue.put(item)

@staticmethod
def _compute_actual_transfer_timeout(item):
Expand Down
12 changes: 12 additions & 0 deletions lib/rucio/tests/test_download.py
Expand Up @@ -86,6 +86,18 @@ def test_download_without_base_dir(rse_factory, did_factory, download_client):
shutil.rmtree(scope)


def test_download_exception_return_information(did_factory, rse_factory, download_client):
rse, _ = rse_factory.make_posix_rse()
did = did_factory.upload_test_file(rse)
did_str = '%s:%s' % (did['scope'], did['name'])

with patch('rucio.client.downloadclient.DownloadClient._download_item', side_effect=Exception()):
res = download_client.download_dids([{"did": did_str}], deactivate_file_download_exceptions=True)

assert len(res) == 1
assert res[0]["clientState"] == "FAILED"


@pytest.mark.dirty(reason='creates a new scope which is not cleaned up')
def test_overlapping_did_names(rse_factory, did_factory, download_client, root_account, mock_scope, vo):
"""
Expand Down

0 comments on commit 00bf7e2

Please sign in to comment.