Try to improve hidden service reachability during sleep #83
Conversation
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.
The issue at the moment is that while the device is sleeping for long periods of time, it is possible for the HS to become unreachable as a result of Tor detecting a clock jump of length greater than
NUM_JUMPED_SECONDS_BEFORE_WARN(100 seconds) upon waking up, which then closes all circuits. Another issue is that if the device was woken up by incoming network traffic, the device only stays awake for about a second before going back to sleep, which isn't enough time for Tor to rebuild the intro circuits, and thus the HS is no longer reachable until Tor is able to rebuild the circuits.I attempt to improve this situation in two ways:
NUM_JUMPED_SECONDS_BEFORE_WARNfrom 100 seconds to 600 seconds to avoid triggering the clock-jumped-close-all-circuits code every time the device wakes up from sleep.MARKCONNFORWAKELOCK) and event (WAKELOCK) to the control port to allow Tor to synchronously signal Orbot to hold wake lock on behalf of Tor (since it isn't possible to hold a wake lock from native code). A wake lock is acquired at the start of a event callback, then released when libevent returns from its event loop when there are no active events. This prevents the device from sleeping when Tor still has work to do.The text was updated successfully, but these errors were encountered: