This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
A Ctrl-C that makes JPype fail with "Fatal error occurred" is a KeyboardInterrupt - #438
Merged
Merged
Conversation
…ardInterrupt (#437) raise_pending_interrupt now maps JPype's RuntimeError("Fatal error occurred") to the KeyboardInterrupt it means, chained from the ArcadeDBError. A KeyboardInterrupt raised on entering a Python function's callback left nothing for the bindings to read, so the statement ended as ArcadeDBError in about 5% of runs of the SIGINT test (15 of 300 before, 0 of 300 after). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #437.
A Ctrl-C during a statement that calls a Python function reached the caller as
ArcadeDBError: Query failed: Fatal error occurredin about 5% of runs, which is the intermittent CI failure oftest_sigint_during_a_query_that_calls_python_is_a_keyboard_interrupt(main 9d4db4b darwin/arm64 3.13, PR #407 linux/amd64 3.14). Cause: JPype interrupts the Java thread before it tells Python about the SIGINT (jpype-project/jpype#1496), so its conversion of the engine's exception fails and it raises a plainRuntimeError("Fatal error occurred"). When theKeyboardInterruptwas raised on entering the callback, the bindings had recorded nothing and theRuntimeErroris not a Java exception, so it stayed anArcadeDBError.The fix is in
raise_pending_interrupt: JPype'sRuntimeError: Fatal error occurredis treated as the Ctrl-C it means (the callback already did this for an error raised inside the function, now through one shared helper), raised asKeyboardInterruptwith theArcadeDBErrorthat holds the JPype text as its cause. A test with a stand-in Java database coversquery()andcommand()deterministically and fails on the base every time; a statement that fails for another reason is still anArcadeDBError. The docs (api/database.md,known-issues.md,development/testing.md) say what a user sees.Measured on the laptop (linux/amd64, Python 3.14, merged-main wheel, one pytest process per run, two concurrent loops on cores 12-13 and 14-15 under
nice -n 10 taskset): the real-signal test failed 15 of 300 runs on the base and 0 of 300 with the fix. Also run:test_python_function_interrupt.pyandtest_interrupt_hygiene.py(all pass),uvx pre-commit run --fileson the changed files, and the strict mkdocs build as indocs-build.yml.🤖 Generated with Claude Code