Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #28865

Closed (moved)
(moved)
Open
Created Dec 17, 2018 by teor@teor

sbws keeps the number of AsyncResults less than the number of threads

This ticket is a follow-up to #28864 (moved).

multiprocessing.Pool can accept any number of queued AsyncResults: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool

But sbws waits for 5 seconds when there are max_pending_results queued AsyncResults: https://github.com/torproject/sbws/blob/ee64d76df54ceb3a3c9e1e2a797fd70d68bb0035/sbws/core/scanner.py#L359-L361

This sbws code is unnecessary, because Pool manages its own queue of AsyncResults.

There are two different ways that this code blocks execution:

  • when a result finishes, the time.sleep(5) call blocks the thread from getting a new AsyncResult for up to 5 seconds
  • if max_pending_results AsyncResults ever block, the process hangs
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking