Skip to content
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

Set future state to "failed" on orchestration errors? #671

Open
HenrikBengtsson opened this issue Mar 10, 2023 · 0 comments
Open

Set future state to "failed" on orchestration errors? #671

HenrikBengtsson opened this issue Mar 10, 2023 · 0 comments

Comments

@HenrikBengtsson
Copy link
Collaborator

HenrikBengtsson commented Mar 10, 2023

For example,

library(future)
plan(multicore)
f <- future(tools::pskill(pid = Sys.getpid()))
r <- result(f)
# Error: Failed to retrieve the result of MulticoreFuture (<none>) from the
# forked worker (on localhost; PID 1136927). Post-mortem diagnostic: No process
# exists with this PID, i.e. the forked localhost worker is no longer alive
> r <- tryCatch(result(f), error = identity)
> class(r)
[1] "FutureError"     "error"           "FutureCondition" "condition"      
> f$state
[1] "running"

Suggestion

When there is a non-recoverable FutureError, set the state of the future to "failed". This can then be used to prevent further attempts to retrieve the result(). OTH, this requires that we know the problem cannot be recovered from. For instance, if it's due to a temporary communication issue, it might work when we call result(f) at a later stage.

See also

This is related to Issue #667.

@HenrikBengtsson HenrikBengtsson changed the title Make sure to set future state to "failed" on orchestration errors Set future state to "failed" on orchestration errors? Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant