Skip to content
Snippets Groups Projects

Bug28869

Closed juga requested to merge github/fork/juga0/bug28869 into master

Created by: juga0

Merge request reports

Approval is optional

Closed by avatar (Jan 10, 2025 4:56am UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 1 __version__ = '1.0.3-dev0'
2
3
4 import threading
5
6 from . import globals # noqa
7
8
  • Author Owner

    Created by: asn-d6

    Hmm, I don't quite understand what's going on here and the commit does not explain what this is used for? Perhaps add some more docs to explain this addition to the init file? What are we trying to achieve? Why does this go into the init.py file and not in a settings.py file or something?

  • juga
    juga @juga started a thread on commit 57c012b4
  • 270 270
    271 271
    272 272 def dispatch_worker_thread(*a, **kw):
    273 try:
    274 return measure_relay(*a, **kw)
    275 except Exception as err:
    276 log.exception('Unhandled exception in worker thread')
    277 raise err
    273 return measure_relay(*a, **kw)
    • Author Owner

      Created by: asn-d6

      Does this stop us from raising an exception? Doesn't it still raise an exception if it triggers?

  • juga
    juga @juga started a thread on commit 57c012b4
  • 119 118 'target': conf.getfloat('scanner', 'download_target'),
    120 119 'max': conf.getfloat('scanner', 'download_max'),
    121 120 }
    122 while len(results) < num_downloads:
    121 while len(results) < num_downloads and not settings.end_event.is_set():
    • Author Owner

      Created by: asn-d6

      Hmm, why are we checking the end_event here? This does not seem to be part of the scanner: use end event singleton commit message explanation.

  • juga
    juga @juga started a thread on commit 57c012b4
  • 354 354 return closure
    355 355
    356 356
    357 def main_loop(args, conf, controller, relay_list, circuit_builder, result_dump,
    358 relay_prioritizer, destinations, max_pending_results, pool):
    359 pending_results = []
    360 while not settings.end_event.is_set():
    361 num_relays = 0
    362 loop_tstart = time.time()
    363 for target in relay_prioritizer.best_priority():
    364 if settings.end_event.is_set():
    • Author Owner

      Created by: asn-d6

      Why do we need to check settings.end_event.is_set() twice in this function?

  • juga
  • juga
    juga @juga started a thread on commit 57c012b4
  • 270 270
    271 271
    272 272 def dispatch_worker_thread(*a, **kw):
    273 try:
    274 return measure_relay(*a, **kw)
    275 except Exception as err:
    276 log.exception('Unhandled exception in worker thread')
    277 raise err
    273 return measure_relay(*a, **kw)
    • Author Owner

      Created by: juga0

      Yes, an exception will be raised if it's triggered. Wrong commit message, i just wanted to remove the log.

  • juga
    juga @juga started a thread on commit 57c012b4
  • 119 118 'target': conf.getfloat('scanner', 'download_target'),
    120 119 'max': conf.getfloat('scanner', 'download_max'),
    121 120 }
    122 while len(results) < num_downloads:
    121 while len(results) < num_downloads and not settings.end_event.is_set():
    • Author Owner

      Created by: juga0

      hmm, it does use the end_event singleton. The intention is to don't start new request when sbws is ending.

  • juga
    juga @juga started a thread on commit 57c012b4
  • 119 118 'target': conf.getfloat('scanner', 'download_target'),
    120 119 'max': conf.getfloat('scanner', 'download_max'),
    121 120 }
    122 while len(results) < num_downloads:
    121 while len(results) < num_downloads and not settings.end_event.is_set():
    • Author Owner

      Created by: juga0

      Otherwise, finishing sbws would mean to wait for all the new requests.

  • juga
    juga @juga started a thread on commit 57c012b4
  • 354 354 return closure
    355 355
    356 356
    357 def main_loop(args, conf, controller, relay_list, circuit_builder, result_dump,
    358 relay_prioritizer, destinations, max_pending_results, pool):
    359 pending_results = []
    360 while not settings.end_event.is_set():
    361 num_relays = 0
    362 loop_tstart = time.time()
    363 for target in relay_prioritizer.best_priority():
    364 if settings.end_event.is_set():
    • Author Owner

      Created by: juga0

      To don't start a new loop measuring relays (it takes ~3 hours) when sbws is finishing.

  • juga
  • juga
    juga @juga started a thread on commit 57c012b4
  • 270 270
    271 271
    272 272 def dispatch_worker_thread(*a, **kw):
    273 try:
    274 return measure_relay(*a, **kw)
    275 except Exception as err:
    276 log.exception('Unhandled exception in worker thread')
    277 raise err
    273 return measure_relay(*a, **kw)
  • juga
    juga @juga started a thread on commit 57c012b4
  • 119 118 'target': conf.getfloat('scanner', 'download_target'),
    120 119 'max': conf.getfloat('scanner', 'download_max'),
    121 120 }
    122 while len(results) < num_downloads:
    121 while len(results) < num_downloads and not settings.end_event.is_set():
  • juga
  • juga
    juga @juga started a thread on commit 57c012b4
  • 354 354 return closure
    355 355
    356 356
    357 def main_loop(args, conf, controller, relay_list, circuit_builder, result_dump,
    358 relay_prioritizer, destinations, max_pending_results, pool):
    359 pending_results = []
    360 while not settings.end_event.is_set():
    361 num_relays = 0
    362 loop_tstart = time.time()
    363 for target in relay_prioritizer.best_priority():
    364 if settings.end_event.is_set():
  • juga
  • juga
  • juga
  • juga
  • Author Owner

    Created by: juga0

    Squashed and merged.

  • Please register or sign in to reply
    Loading