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

Retrieval Tool: Indicates "complete" before all transfers finish #185

Merged
merged 2 commits into from Oct 26, 2023

Conversation

mikejritter
Copy link
Contributor

JIRA Ticket: https://duracloud.atlassian.net/browse/DURACLOUD-1069

  • Other Relevant Links (Mailing list discussion, related pull requests, etc.)

What does this Pull Request do?

This updates the shutdown logic of the RetrievalManager to use a phaser to track work completion instead of using awaitTermination.

How should this be tested?

  • Rebuild the retrieval tool
  • Run the tool on a large-ish space
  • When the final status message is printed there should no longer be any retrievals in progress

Additional Notes:

I was considering using submit to return a future and do a get on each to emulate joining the threads, but wasn't sure what the typical space would look like and didn't want a growing list of futures. Not a big deal just an alternate solution which might be a little bit simpler.

Interested parties

Tag (@ mention) interested parties or, if unsure, @duracloud/committers

} catch (InterruptedException e) {
// Exit wait on interruption
}
phaser.arriveAndAwaitAdvance();
Copy link
Member

Choose a reason for hiding this comment

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

If you wouldn't mind adding a log message before arriveAndAwaitAdvance indicating that the application is waiting for the last retrievals to complete (and that it may take a few minutes depending on the size of the retrieval and the connection speed), I think that would be an improvment..

@dbernstein
Copy link
Member

Spaces can be very large (millions of items) so preventing growing list of futures is a good idea. As long as this change allows parallel downloads I think this is the right solution.

@dbernstein
Copy link
Member

I gave this a test: it works great. Thanks @mikejritter

@dbernstein dbernstein merged commit b87519d into duracloud:develop Oct 26, 2023
1 check passed
@mikejritter mikejritter deleted the dc-1069-phaser branch October 27, 2023 17:01
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

2 participants