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

Clean tor directory at startup #5903

Closed

Conversation

chimp1984
Copy link
Contributor

This PR is an intent to fight the messaging issues. We had in the past sometimes issues that Tor became instable and deleting the tor directory (excluding the hidden service dir) solved that. So it might be worth to see if it helps if we reset at each startup the tor directory.
The startup time for Tor is a bit slower as it need to download about 10MB of data.

Tests showed that it takes about 8 seconds longer. On a slow internet connection its about 15-25 sec slower.

I dont have a very strong opinion if we should use that PR as the chances that it fixes the problem are not super high, but its a relatively cheap attempt which comes with only a small delay at startup. Give a thumbs up/down if you support that PR.
I researched also to find if there are reported bugs with corrupted/outdated tor data but could not find much beside that at shutdown the decriptor files might get corrupted, but I assume that would lead to problems as starting Tor.

Normal:

bisq.log:Tor started after 6736 ms. Start publishing hidden service.
bisq.log:Tor started after 6182 ms. Start publishing hidden service.
bisq.log:Tor started after 5802 ms. Start publishing hidden service.
bisq.log:Tor started after 6286 ms. Start publishing hidden service.
bisq.log:Tor started after 6303 ms. Start publishing hidden service.

With that PR:

bisq.log:Tor started after 14819 ms. Start publishing hidden service.
bisq.log:Tor started after 13833 ms. Start publishing hidden service.
bisq.log:Tor started after 12840 ms. Start publishing hidden service.
bisq.log:Tor started after 13760 ms. Start publishing hidden service.

@ripcurlx ripcurlx modified the milestones: v1.8.0, v1.8.1 Dec 8, 2021
@wiz
Copy link
Member

wiz commented Dec 11, 2021

Hmm, I am not sure this is a good idea as there are tradeoffs to configure - for example, it might cause people to have better Tor connectivity in the short-term but it might cause users to get rate-limited from Tor more often (i.e. banned) in the long-run. Are we detecting when Bisq gets rate limited by Tor now? Originally reported in #4328

@wiz
Copy link
Member

wiz commented Dec 11, 2021

As a comparison, Tor Browser has the following buttons in the browser:
Screen Shot 2021-12-11 at 14 42 13
Perhaps we could expose these buttons to allow users to manually clear Tor files when necessary, and also clear Tor files when certain states are detected (such as rate-limiting), or at least less frequently and more time based such as once per day or once per week, but not always on every startup?

@ripcurlx ripcurlx modified the milestones: v1.8.1, v1.8.2 Jan 12, 2022
@alkum
Copy link
Contributor

alkum commented Jan 28, 2022

I tend to agree with @wiz, the tradeoff doesn't seem worth it.

How about having an optional startup flag that could trigger this, if necessary?

@chimp1984
Copy link
Contributor Author

Yes I also agree to better not touch that.
The Tor settings have already the option to clean the tor dir. But it is not easy to find and not available at startup, so that is a UI issue which could relatively easy be solved. I close that for now but any dev is welcome to pick that idea up from here.

@chimp1984 chimp1984 closed this Jan 31, 2022
@chimp1984 chimp1984 deleted the clear_tor_files_at_startup branch October 20, 2022 16:25
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

4 participants