-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Milestone
Description
Add S3 methods psKill() for cluster to send a signal to the cluster node R process, e.g.
> cl <- parallelly::makeClusterPSOCK(4L)
> isAlive(cl)
[1] TRUE TRUE TRUE TRUE
> psKill(cl[2:3], signal = tools::SIGINT)
> Sys.sleep(10)
> isAlive(cl)
[1] TRUE FALSE FALSE TRUEFor localhost workers, we can use tools::pskill(pid, signal = ...). For remote ones, we need to call pskill -SIG $PID over a remote connection.
This will allow us to terminate stalled workers and set up new ones, e.g.
> alive <- isAlive(cl)
> if (!all(alive)) cl <- c(cl[alive], makeClusterPSOCK(length(cl) - sum(!alive)))
> isAlive(cl)
[1] TRUE TRUE TRUE TRUEReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels