Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S sbws
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Network Health
  • sbws
  • Issues
  • #28865
Closed
Open
Issue 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 legacy/trac#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
Assignee
Assign to
Time tracking