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

CLI client may not exit upon some processing errors #136

Closed
atomashpolskiy opened this issue Dec 16, 2019 · 0 comments · Fixed by #211
Closed

CLI client may not exit upon some processing errors #136

atomashpolskiy opened this issue Dec 16, 2019 · 0 comments · Fixed by #211

Comments

@atomashpolskiy
Copy link
Owner

Because in CliClient.resume() we don't account for the case, when there is an exception in one of the async processing stages:

void resume() {
	...
	try {
		client.startAsync(state -> {
			printer.ifPresent(p -> p.print(state));
			if (!options.shouldSeedAfterDownloaded() && state.getPiecesRemaining() == 0) {
				runtime.shutdown();
			}
		}, 1000); // <-- CompletableFuture.whenComplete(it, ex) callback is needed here
	} catch (Throwable e) {
		// in case the start request to the tracker fails <-- this comment seems outdated
		printer.ifPresent(SessionStatePrinter::shutdown);
		printAndShutdown(e);
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant