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

Core & Internals: simplify list_replica response creation. Closes #4473 #4691

Merged

Conversation

rcarpa
Copy link
Contributor

@rcarpa rcarpa commented Jun 18, 2021

Extract pfn/rse sorting to a separate function and call it in the 2
needed places (each time before yielding the file).

Only resolve parents once per scope/name. As a side note, parents
are not resolved for archives, but this never worked. I don't see
any regression about it in #4473.

@rcarpa rcarpa requested a review from mlassnig as a code owner June 18, 2021 11:48

# don't forget to resolve parents for the last replica
if resolve_parents:
file['pfns'], file['rses'], file['states'] = {}, defaultdict(list), {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the file['states'] was previously file['states'] = {rse_id: str(state.name if state else state)}, now it's just {}

on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is done a couple of lines below.


# don't forget to resolve parents for the last replica
if resolve_parents:
file['pfns'], file['rses'], file['states'] = {}, defaultdict(list), {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is done a couple of lines below.


if rse_id:
file['rses'][rse_id] += list(set([tmp_pfn[0] for tmp_pfn in pfns]))
file['states'][rse_id] = str(state.name if state else state)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

…io#4473

Extract pfn/rse sorting to a separate function and call it in the 2
needed places (each time before yielding the file).

Only resolve parents once per scope/name. As a side note, parents
are not resolved for archives, but this never worked I don't see
any regression about it in rucio#4473.
@rcarpa rcarpa force-pushed the patch-4473-cosmetic_changes_list_replicas branch from 62e2560 to 7a00e4f Compare August 13, 2021 07:52
@bari12 bari12 requested a review from mlassnig September 3, 2021 14:27
@bari12 bari12 merged commit b6092bc into rucio:master Sep 6, 2021
@rcarpa rcarpa deleted the patch-4473-cosmetic_changes_list_replicas branch September 13, 2021 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants