r-dbi / dbi3

DBI revisited
https://r-dbi.github.io/dbi3
37 stars 2 forks source link

Query cancellation #20

Open krlmlr opened 4 years ago

krlmlr commented 4 years ago

This seems to be a more severe issue than anticipated. Cancelling queries seems generally very poorly supported.

As a user, I want to be able to cancel a long-running query at any time. If the connection dies, I can recover, but I'd rather not restart R.

A "hammer-like" solution would be a generic DBI backend that instantiates the connection in a separate process. Similarly to {DBIlog}, this can be a wrapper that wraps arbitrary DBI backends. The DBIDriver class of this connection would hold the handle to the remote process.

CC @hannesmuehleisen.

isteves commented 4 years ago

Upvoting this issue in case it helps with prioritization! My current workaround involves finding a PID via an internal query monitor, and then canceling it through a separate IDE (RubyMine, to be specific). ...Just so I don't have to force-quit RStudio to stop the query.

hannes commented 4 years ago

@isteves which package is that?

isteves commented 4 years ago

@hannesmuehleisen do you mean RubyMine? It's an IDE that we happen to use for running SQL queries/etc (mostly for historical reasons). It has better SQL formatting options than RStudio and also allows canceling queries easily. https://www.jetbrains.com/ruby/

krlmlr commented 2 years ago

The RStudio IDE got a little better in cancelling stuck R processes. Closing for now, will bookmark this issue.

abalter commented 1 year ago

@krlmlr --- I wouldn't stay its really any better. And data (and therefore queries) just get bigger every day.