fix(core): handle intermittent signal interrupt test failures - #5273
fix(core): handle intermittent signal interrupt test failures#5273eshaanag wants to merge 1 commit into
Conversation
25ccb9f to
43f02c6
Compare
|
@eshaanag thanks for the PR, you've added interrupt related changes which are unrelated and should have been a seperate PR, so we've merged #5279 instead. Could you update the PR description and title to address only the signal inturrupt related changes? Also I've not seen this failure consistently but only happening sometimes, can you explain that? Like for example all tests passed in https://github.com/aboutcode-org/scancode-toolkit/runs/98624035607 without this. |
|
@AyanSinhaMahapatra The PR title and description have been updated to reflect only the signal interrupt changes. Regarding the inconsistent test failures: |
Signed-off-by: Eshaan Agrawal <agrawaleshaan12@gmail.com>
43f02c6 to
d072c00
Compare
This pull request modifies the interrupt handling implementation in
src/scancode/interrupt.pyby removing the reliance onPyThreadState_SetAsyncExc.The
PyThreadState_SetAsyncExcAPI is non-deterministic. Injecting asynchronous exceptions into threads relies on the Python GIL state. If a thread is blocked in a system call or C extension without releasing the GIL correctly, the exception is delayed and may trigger during test teardown or critical sections. This leads to inconsistent race conditions and intermittent SIGINT test failures across different CI runner environments.Changes:
PyThreadState_SetAsyncExclogic ininterrupt.py.