-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve interrupt behavior #433
Comments
Hey Jim - Isn't SQLCancel called by nanodbc when some of the resources are destroyed? If so, I wonder if we can get there by looking into opportunities to |
yeah, I think that would likely work. Rcpp throws a Line 158 in 731b46f
|
I don't think the problem is with retrieving the results; it's submitting the query. |
That makes sense; I think the Should we try it? Is there a way to test if that helps with the issue. Happy to submit the patch. |
@isteves do you happen to have a reprex for a slow query that we could use for testing? |
Oh here's a good one from @krlmlr: rstudio/rstudio#8865 (comment) |
Hey @hadley, @jimhester: I don't think anything we do here, short of real
I think we can make it so that we release the resources when the interrupt is caught (rather than on subsequent query). Does that sound reasonable? |
@jimhester in the past I used DBI+RPostgreSQL and now I use |
@detule just to be clear — what you're saying is that query will continue to run on the database, but control will immediately return to R? How much work would a real async approach be? |
@hadley - No, I think the goal of wrapping the existing I think for control to immediately return to [R] some form of actual Alternatively, one could go the C++ route, i think at this point C++11 is required to build |
@detule that sounds like good a thing to do, but it's not the motivation behind this issue (so I don't want it to get lost). |
Closed via #796.🥳 |
Right now we check for interrupts on the R side, but don't attempt to do anything to signal to the database that an interrupt occurred.
Either calling
SQLCancel()
on the statement, orSQLFreeStmt()
should do it, though we will need to test to make sure.If that doesn't work then we may have to switch to using async queries, though I would prefer to avoid that complexity if possible.
The text was updated successfully, but these errors were encountered: