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

Improve handling when unable to connect to tor #2399

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

devinbileck
Copy link
Member

Issue: If an IOException is raised when attempting to create
tor and the hidden service, the application will just quit without
any indication to the user. One particular scenario where this occurs
is mentioned in #2398.

Cause: There is an explicit statement to exit the application when an
IOException is raised.

Fix: Rather than just exit the application, show an error message
and inform the user what went wrong.

Issue: If an IOException is raised when attempting to create
tor and the hidden service, the application will just quit without
any indication to the user. One particular scenario where this occurs
is mentioned in bisq-network#2398.

Cause: There is an explicit statement to exit the application when an
IOException is raised.

Fix: Rather than just exit the application, show an error message
and inform the user what went wrong.
@ghost
Copy link

ghost commented Feb 9, 2019

Thanks @devinbileck for intercepting this exception early enough.
This should help with the support !

@ManfredKarrer ManfredKarrer requested review from sqrrm, blabno and freimair and removed request for ManfredKarrer, sqrrm and blabno February 9, 2019 14:00
Copy link
Contributor

@freimair freimair left a comment

Choose a reason for hiding this comment

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

Has been on my list for quite some time now. Thanks! utAck

@lichuan
Copy link
Contributor

lichuan commented Feb 10, 2019

Yes, this happened in China, the GFW prevent us connecting TOR, and the Bisq application quit without any dialogs.

@ManfredKarrer
Copy link
Contributor

@freimair If there is a tor connection problem the tor settings windows should get displayed. There the user can choose a plugable transport or other custom settings.

@devinbileck
Copy link
Member Author

@ManfredKarrer I agree that it should appear in the case of a connection/communication problem. But in this case it is a setup problem (i.e. cant setup/launch tor in the first place) so there is no need since changing connection settings would have no effect.

@freimair
Copy link
Contributor

@ManfredKarrer yes, @devinbileck is right - this code path is mainly used when trying to use system tor. when the connection fails there is nothing we can do.
maybe we want to integrate configuration for system tor into the settings page some time...

System.exit(1);
UserThread.execute(() -> {
setupListeners.stream().forEach(s -> s.onSetupFailed(new RuntimeException(e.getMessage())));
});
} catch (Throwable ignore) {
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@freimair Since I removed restartTor(throwable.getMessage()); from onFailure below since I didn't want it to be called after handling IOException above, perhaps I should add it to this ignored exception?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can force onSuccess by return null; after triggering the onSetupFailed and let the onFailure be?

And yes, this class cries for being refactored :)

Copy link
Member Author

Choose a reason for hiding this comment

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

In fact we are already doing that. Let me review this again. I should be able to add restartTor back to onFailure.

@devinbileck
Copy link
Member Author

@freimair Integrating configuration for system tor into the settings page sounds like a good idea to me. Perhaps you can open an issue?

@ripcurlx
Copy link
Contributor

@devinbileck Is there anything you want to add to this PR, otherwise I would give it an utACK as well and merge it to master for the upcoming release.

@ManfredKarrer
Copy link
Contributor

@ripcurlx Please wait with merge for another 1-2 days to get feedback from @freimair .

Copy link
Contributor

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

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

ACK

@ManfredKarrer ManfredKarrer merged commit 93558ef into bisq-network:master Feb 14, 2019
@devinbileck devinbileck deleted the tor-setup-failure branch February 14, 2019 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants