Repository navigation
Conversation
Accepted limitationsThe clean review of the split found nothing above Low. Its finding 3, the documentation that said these settings are read on the first open in the process, is fixed in c3b58ae: they are read each time a remote database is opened. This remains from the reviews of the combined version:
Generated by Claude Code |
c3b58ae to
86d031b
Compare
The HTTP VFS set no libcurl limits, so a server that accepted a connection and never answered blocked R indefinitely, and with it any `R CMD check` that runs the HTTP VFS tests. Every handle now gives up connecting after `RSQLITE_HTTP_CONNECT_TIMEOUT` seconds (default 30), and aborts a transfer that receives less than one byte per second for `RSQLITE_HTTP_STALL_TIMEOUT` seconds (default 60). The aborted transfer fails the open with "unable to open database file" and a query with "disk I/O error". Only whole numbers of seconds of at least 1 are honored, in any notation R writes such as `1e+05`, and values above 2147483 seconds, the largest connect timeout libcurl accepts, are capped. Anything else, such as `0`, `2.9`, `inf` or `5abc`, uses the default, as `?sqliteHttpConfig` now documents, along with the cap of 65535 seconds that libcurl 8.19.0 or later sets on the stall timeout itself. A handle whose limits cannot be set is not used, since it could block forever, and the open then fails with "unable to open database file", a query with "disk I/O error". Opening probed the server up to four times, because the file size and the header read each start a HEAD and a GET request. A failed probe is no longer repeated within one open, and a HEAD request that cannot connect or times out skips the GET, so a silent server costs one timeout. The test server can now accept requests without ever answering them. A new test opens such a server with a one-second stall timeout, and checks that the server received exactly one request, the HEAD, so a refused connection cannot pass for a stall. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
The documentation said the values are read on the first open in the process. They are in fact read each time a remote database is opened, in httpOpen() and in the metadata probe, which includes RSQLITE_HTTP_CONNECT_TIMEOUT and RSQLITE_HTTP_STALL_TIMEOUT. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
86d031b to
e186699
Compare
|
@davidrsch: This and the next PR change the extension's code. What do you think? Do we need this? |
|
Thanks for asking. #842: yes. Without a timeout, a server that never answers hangs R and #843: I'd rather not as is. It makes |
The HTTP VFS set no libcurl limits, so a server that accepted a connection and never answered blocked R, and with it
R CMD check, indefinitely. Every handle now gives up connecting afterRSQLITE_HTTP_CONNECT_TIMEOUTseconds (default 30) and aborts a transfer that receives less than one byte per second forRSQLITE_HTTP_STALL_TIMEOUTseconds (default 60). Only whole numbers of seconds of at least 1 are honored, in any notation R writes such as1e+05; larger values are capped at 2147483 seconds (and libcurl 8.19.0 or later caps the stall timeout at 65535 seconds itself), and anything else uses the default, as documented in?sqliteHttpConfig, which now also says that these settings are read each time a remote database is opened. A handle whose limits cannot be set is not used, and the open then fails with "unable to open database file", a query with "disk I/O error".Opening used to probe the server up to four times, since the file size and the header read each sent a HEAD and a GET. A failed probe is now not repeated within one open, and a HEAD that cannot connect or times out skips the GET, so a silent server costs one timeout. A stall during the open reports "unable to open database file", during a query "disk I/O error".
The test server can now accept requests without answering them. A new test opens such a server with
RSQLITE_HTTP_STALL_TIMEOUT=1, expects the open to fail within seconds, and checks that the server received exactly one request, the HEAD, so a refused connection cannot pass for a stall.An interrupt still cannot abort a transfer here: Ctrl-C takes effect only once the stall timeout ends the transfer. #843 adds that, and completes the wording on aborted transfers in the documentation.
Part of the stack that splits the earlier combined #832 into scoped pull requests, as the maintainer asked there. This code was reviewed as part of #832, in three clean reviews of the combined version; a clean review of the split found one Low finding here, in the documentation, fixed in c3b58ae, and what remains is under Accepted limitations.
https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
Generated by Claude Code