-
Notifications
You must be signed in to change notification settings - Fork 38
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
r_bg exit status always 0 #291
Comments
We can probably exit with 1, although AFAIR we also want to run the post-hook, if any. In general, I expected people to use proc <- callr::r_bg(function() quux)
proc$wait()
proc$get_result()
|
I see, which means |
Thanks for taking a look! Maybe your patch is fine, IDK, I only have vague memories that there is a post-hook. I'll take a look as well, soon. |
callr::r_bg
always returns 0 even on error, despite R's default behavior (from?q
: The default error handler for non-interactive use effectively callsq("no", 1, FALSE)
and returns error status 1.)With
callr
though, we always get 0:I recognize I can use
rscript_process
to get the desired effect:I suggest would be more consistent if the
error=
andinterrupt=
handlers in the wrapper used bycallr::r_bg
end withq(save="no", status=1)
.With that, I see the desired behavior:
Are there other aspects that would need to be addressed as well? (That is, what else could be changed for this to be a more complete solution?) Or is there rationale for having
r_bg
always return status 0?I'm running R-4.3.3 and callr_3.7.6 within emacs/ess on ubuntu-24.04.
The text was updated successfully, but these errors were encountered: