[tor-bugs] #28897 [Core Tor/sbws]: Stop running twice destination usability tests
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Dec 19 18:26:08 UTC 2018
#28897: Stop running twice destination usability tests
---------------------------+-----------------------------------
Reporter: juga | Owner: juga
Type: defect | Status: needs_review
Priority: Medium | Milestone: sbws: 1.0.x-final
Component: Core Tor/sbws | Version: sbws: 1.0.2
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: #28663 | Points:
Reviewer: | Sponsor:
---------------------------+-----------------------------------
Changes (by juga):
* status: assigned => needs_review
Comment:
I think this is what is making sbws stalls.
A backtrace [0] in the moment it's stalled shows two threads trying to get
the next destination.
It locks
https://github.com/torproject/sbws/blob/ee64d76df54ceb3a3c9e1e2a797fd70d68bb0035/sbws/lib/destination.py#L248,
then while True, then if it enters in _perform_usability_test, will lock
again, then call _is_usable, which call connect_destination_over_circuit
which locks again. If it fails then it sleep.
Many times connect_to_destination_over_circuit fails several times in a
row, cause it's not reliable to do it through Tor and random relays.
If _usable_dests is not overwritten every time that a destination is
chosen, then a lock is only needed in connect_destination_over_circuit.
It would be better to refactor all this code to trace it and debug it
easier.
As a temporal solution, the "usability" can be tracked out of the class
and without locks.
For now i'd just disable checking for usability, and prioritize the
refactoring ticket as soon as 1.0 is done.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28897#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list