Repository navigation
Conversation
…ad of crashing R `set_busy_handler()` registered `busy_callback_helper()` with `NULL` data when given `NULL`, so the next busy event aborted R. It now unregisters the busy handler, which also clears a timeout, so that a locked database fails immediately as documented. `disconnect()` unregisters the busy handler before it releases the R callback. Closes #968. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
… or handler `NULL` also removes a timeout or handler function set before, and each call replaces what the previous one set. A new subprocess test checks that a replaced handler is no longer called, and that a handler still set at `dbDisconnect()` with an open result does not crash R. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #968.
sqliteSetBusyHandler(con, NULL)now removes the busy handler and any timeout, so that a locked database fails immediately with "database is locked", as?sqliteSetBusyHandlerdocuments forNULL. Before,set_busy_handler()registeredbusy_callback_helper()withNULLdata, and the next busy event aborted R, whether or not a handler or timeout had been set before.set_busy_handler()now always unregisters the previous handler first, and returns after releasing the R callback when givenNULL.disconnect()also unregisters the busy handler before it releases the R callback, becausesqlite3_close_v2()keeps the handle alive while statements remain.?sqliteSetBusyHandlernow says thatNULLalso removes a timeout or handler function set before, and that each call replaces what the previous one set.The new test in
test-dbConnect.Rruns the busy events in acallr::r()subprocess, so that a regression fails the test instead of aborting the test run. Like the existing interrupt test, it uses the installed package. It checksNULLon a fresh connection, after a function handler and after a timeout, each failing with "database is locked" in under five seconds. Red onmain(fb8effe): the subprocess crashes (callr subprocess failed: ... has crashed or was killed). Green with the fix. A sibling subprocess test checks that a replaced handler function is no longer called, that a function set after a timeout is called, and that a handler still set atdbDisconnect()while a result is open neither crashes R nor is called; it passes onmaintoo and guards against regressions. Full suite withNOT_CRAN=true: FAIL 0, WARN 3, SKIP 63, PASS 10716.This fix is not part of the rebuilt chain planned in #880.
Coordinating session: https://claude.ai/code/session_01Hr1rd7QnTD4acgzTUihnF4
Generated by Claude Code