This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
Make polling for tor restart work. Call setupTor only once. #14585
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, we would never retry polling for tor launch if we ever
made the decision to open a control connection.
If we haven't successfully opened a control connection, make
sure we call this._polled() on all error paths to process a
deferred file system watch notification.
If we have opened a control connection enough to set the
close
event handler, call this._polled() to handle a deferred poll
(which, in the next tick, will either do the work it needs to do,
or discover that there is already a control connection and do
nothing).
In the
close
event handler for the control connection, poll fortor launch in case tor relaunched, and all the watch events were
received and ignored, before we noticed that the control
connection had closed.
With this, browser-laptop will notice when the tor daemon has come
back after muon executes ses.relaunchTor, without needing to call
setupTor again -- which might have had unpredictable consequences of
multiple simultaneous file system watchers and control connections to
tor.
fix #14584
Auditors: @diracdeltas
Test Plan:
tor: daemon listens on ...
.tor: daemon listens on ...
again.Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests