You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interrupt seems to be caught by select() on the socket, not by Rcpp::checkUserInterrupt() as intended by the code. This leads to an error message Rcpp::exception: select() failed with error code 4 (where 4 means EINTR), and the subsequent cleanup (in an overarching try-catch?) still waits for the query to complete.
Same on macOS and Linux. Not tested on Windows.
session<-callr::r_session$new()
session$run(function() {
library(RPostgres)
.GlobalEnv$conn<- dbConnect(Postgres(), check_interrupts=TRUE)
invisible()
})
#> NULLsession$call(function() {
tryCatch(
print(dbGetQuery(.GlobalEnv$conn, "SELECT pg_sleep(2)")),
error=identity
)
})
session$poll_process(100)
#> [1] "timeout"session$read()
#> NULLsession$interrupt()
#> [1] TRUE# Should take much less than 1.9 seconds
system.time(print(session$poll_process(2000)))
#> [1] "ready"#> user system elapsed #> 0.000 0.001 1.904# Should return a proper error messagesession$read()
#> $code#> [1] 200#> #> $message#> [1] "done callr-rs-result-f8d028852a34"#> #> $result#> <Rcpp::exception: select() failed with error code 4>#> #> $stdout#> [1] ""#> #> $stderr#> [1] ""#> #> $error#> NULL#> #> attr(,"class")#> [1] "callr_session_result"
- `dbConnect(check_interrupts = TRUE)` now aborts a running query faster and more reliably when the user signals an interrupt, e.g. by pressing Ctrl+C (#336).
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
The interrupt seems to be caught by
select()
on the socket, not byRcpp::checkUserInterrupt()
as intended by the code. This leads to an error messageRcpp::exception: select() failed with error code 4
(where 4 meansEINTR
), and the subsequent cleanup (in an overarching try-catch?) still waits for the query to complete.Same on macOS and Linux. Not tested on Windows.
Created on 2021-09-19 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: