kill(manager, pid::Int, config::WorkerConfig)

kill(manager::FooManager, pid::Int, config::WorkerConfig)

Implemented by cluster managers. It is called on the master process, by rmprocs. It should cause the remote worker specified by pid to exit. Base.kill(manager::ClusterManager.....) executes a remote exit() on pid

Examples

  1. Terminate a process:

    julia> proc = run(`sleep 10`)
    julia> kill(proc)

    In this example, the kill function is used to terminate the process proc. By default, it sends the SIGTERM signal to the process, which terminates it.

  2. Send a specific signal to a process:

    julia> proc = run(`sleep 10`)
    julia> kill(proc, SIGINT)

    The kill function can also be used to send a specific signal to a process. In this example, the SIGINT signal is sent to the process proc.

Common mistake example:

julia> proc = run(`sleep 10`)
julia> kill(proc, "SIGTERM")
ERROR: MethodError: no method matching kill(::Base.Process, ::String)

In this example, the wrong signal is provided as a string instead of the corresponding constant from the Libc module. Make sure to use the appropriate constant for the desired signal instead of a string representation.

See Also

accept, bind, :@spawn, connect, fetch, getaddrinfo, gethostname, getipaddr, getsockname, init_worker, IPv4, IPv6, isready, issocket, kill, listen, recv, recvfrom, remotecall, remotecall_fetch, remotecall_wait, RemoteRef, send, setopt,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: