The Wayback Machine - https://web.archive.org/web/20220130235538/https://github.com/atomashpolskiy/bt/issues/136
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

Open
atomashpolskiy opened this issue Dec 16, 2019 · 0 comments
Open

CLI client may not exit upon some processing errors #136

atomashpolskiy opened this issue Dec 16, 2019 · 0 comments

Comments

@atomashpolskiy
Copy link
Owner

@atomashpolskiy atomashpolskiy commented Dec 16, 2019

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
1 participant