Skip to content

Commit

Permalink
poller: add more debug to stopping
Browse files Browse the repository at this point in the history
poller doesn't seem to dump state correctly when exiting. It splats:

Traceback (most recent call last):
  File "nipa/pw_poller.py", line 277, in <module>
    poller.run(life)
  File "nipa/pw_poller.py", line 256, in run
    worker.join()
  File "/usr/lib64/python3.12/threading.py", line 1147, in join
    self._wait_for_tstate_lock()
  File "/usr/lib64/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Add a log message and a handler, just in case.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jun 15, 2024
1 parent a314bac commit dc7450f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def run(self) -> None:
self.done_queue.put(s)
core.log("Tester done processing")

core.log("Tester exiting")

def load_tests(self, name):
core.log_open_sec(name.capitalize() + " tests")
tests_subdir = os.path.join(self.config.get('dirs', 'tests'), name)
Expand Down
2 changes: 2 additions & 0 deletions pw_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ def run(self, life) -> None:
if secs > 0:
log("Sleep", secs)
log_end_sec()
except KeyboardInterrupt:
pass # finally will still run, but don't splat
finally:
log_open_sec(f"Stopping threads")
for worker in self._workers:
Expand Down

0 comments on commit dc7450f

Please sign in to comment.