Skip to content

Handling dead workers in future.apply #732

Discussion options

You must be logged in to vote

Only got a few minutes, but then future.callr::callr works similarly to multisession, but where there is fresh R process spun up for each future. That means, regardless whether the future finished successfully or not, there is no R process left behind. That'll take you the first step. You still have to handle FutureError errors thrown by each future failing because the R process crashed. Such errors are considered so severe that they are not handled by higher-level APIs, e.g. future.apply, *furrr, and doFuture. Instead, you need to roll your own, e.g.

f <- future(<expr>)
v <- tryCatch(value(f), FutureError = identity)
if (inherits(v, "FutureError")) {
  <do something>
}
...

FWIW, the mult…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@felixschweigkofler
Comment options

@HenrikBengtsson
Comment options

@felixschweigkofler
Comment options

Answer selected by felixschweigkofler
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