[tor-bugs] #28864 [Core Tor/sbws]: sbws AsyncResults have no timeout

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Dec 17 07:09:36 UTC 2018


#28864: sbws AsyncResults have no timeout
---------------------------+-----------------------------------
 Reporter:  teor           |          Owner:  (none)
     Type:  defect         |         Status:  new
 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:
---------------------------+-----------------------------------

Comment (by juga):

 Replying to [ticket:28864 teor]:
 > After sbws queues an `AsyncResult`, it will wait forever for the result
 to be ready:
 >
 https://github.com/torproject/sbws/blob/ee64d76df54ceb3a3c9e1e2a797fd70d68bb0035/sbws/core/scanner.py#L359-L364
 >
 > If at least one result hangs, then sbws will hang, because
 `AsyncResult.ready()` does not have a timeout.

 In theory this won't happen, since both circuits and requests have a
 timeout. Also the sleep happen in the main thread, not the thread that is
 getting the results

 > Instead, sbws should call `AsyncResult.wait([timeout])` on each result,
 after calling `pool.apply_async()` on a large number of results.
 >
 > See
 https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.AsyncResult.wait

 I'll try this anyway

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28864#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list