Skip to content

WISH: killNode() for 'cluster' #33

@HenrikBengtsson

Description

@HenrikBengtsson

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 TRUE

For 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 TRUE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions