[tor-bugs] #28866 [Core Tor/sbws]: ResultDump.queue.put() can hang if the queue is full
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Dec 17 07:15:27 UTC 2018
#28866: ResultDump.queue.put() can hang if the queue is full
---------------------------+-----------------------------------
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:28866 teor]:
> sbws calls `ResultDump.queue.put()` in blocking mode:
>
https://github.com/torproject/sbws/blob/ee64d76df54ceb3a3c9e1e2a797fd70d68bb0035/sbws/core/scanner.py#L303
>
> But multiprocessing callbacks need to return immediately:
>
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.apply_async
>
> So sbws should call put() without blocking, or with a (very small)
timeout:
> https://docs.python.org/3/library/queue.html#queue.Queue.put
I'm not sure we can make this callback not blocking, since it'll be
accessing the same part of memory and needs to write to disk. Not sure
either about the small timeout.
I'll try, but dunno how i can test all of this.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28866#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list