Skip to content

Handling dead workers in future.apply #732

Discussion options

You must be logged in to vote

UPDATE: As of future 1.40.0 (2025-04-10), there's no longer a need to orchestrate this manually. Futureverse detects when cluster and multisession workers have crashed and automatically relaunch them in the background. For example, if we launch three futures where one causes the parallel worker to terminate abruptly:

library(future)

cl <- parallelly::makeClusterPSOCK(4)
plan(cluster, workers = cl)
message(sprintf("Number of free workers: %d/%d", nbrOfFreeWorkers(), nbrOfWorkers()))
#> Number of free workers: 4/4

fs <- list()

fs$A <- future(42)
message(sprintf("Number of free workers: %d/%d", nbrOfFreeWorkers(), nbrOfWorkers()))
#> Number of free workers: 3/4

fs$B <- future(tools::pski…

Replies: 2 comments 3 replies

Comment options

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

@HenrikBengtsson
Comment options

@felixschweigkofler
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by HenrikBengtsson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants