Skip to content

Keyboard interrupt: double Ctrl-C too quickly hangs the library #1259

@JordanYates

Description

@JordanYates

If a user attempts to terminate the program a second time with ctrl-c, the interrupt handlers deadlock.
Output logs with -v:

I 11:38:54 station_server - Starting station server at:
  Local: http://localhost:4444
  Remote: http://TAURUS:4444
I 11:38:54 test_descriptor - Executing test:
Enter a DUT ID in order to start the test.
^CE 11:38:56 test_descriptor - Received SIGINT, stopping all tests.
E 11:38:56 test_descriptor - Aborting <openhtf.core.test_descriptor.Test object at 0x7f3568580350> due to SIGINT
E 11:38:56 test_descriptor - Test state: <TestState: None@TAURUS Running Phase: trigger_phase>
E 11:38:56 test_executor - Abort test executor.
^CE 11:38:56 test_descriptor - Received SIGINT, stopping all tests.
^CE 11:39:47 test_descriptor - Received SIGINT, stopping all tests.
^CE 11:39:47 test_descriptor - Received SIGINT, stopping all tests.
^CE 11:39:47 test_descriptor - Received SIGINT, stopping all tests.
^CE 11:39:47 test_descriptor - Received SIGINT, stopping all tests

Backtrace from the python debugger:
Image

The nested handler is waiting forever on the test lock, which was already taken by the original handler:
Image

I suspect this would be solved with internal state that checks whether handle_sig_int is already running.

If this does happen, the only way I have found to terminate the program is via the kill command.

openhtf version: v1.6.1
OS: Ubuntu 24.04, under WSL2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions