Skip to content

Catch terminated/killed workers #583

Answered by HenrikBengtsson
mmyrte asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I glad to hear you find the package useful. I refer to such errors "orchestration" errors, in contract, to run-time errors (e.g. log("a")). All orchestration errors signaled are of class FutureError, which you can catch when calling value(), e.g.

library(future)
plan(multicore)

## Emulate a crash multicore worker
f <- future({ tools::pskill(Sys.getpid()); 42 })

v <- value(f)
#> Error: Failed to retrieve the result of MulticoreFuture (<none>)
#> from the forked worker (on localhost; PID 25336). Post-mortem
#> diagnostic: No process exists with this PID, i.e. the forked
#> localhost worker is no longer alive
#> In addition: Warning message:
#> In mccollect(jobs = jobs, wait = TRUE) :
#>…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mmyrte
Comment options

Answer selected by mmyrte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants