How to ignore terminated process in pmap with no retry

When a worker process in pmap gets killed, the parent worker aborts with a ProcessExitedException. Is there any way to prevent this? Fault tolerant `pmap` when worker goes down shows that it works when you specify a retry delay, but I don’t want to retry.
Example:

using Distributed
addprocs(2)

@everywhere function foo(i)
    if myid() == 2
        exit(1) 
        # throw(ErrorException()) # works as expected
    end
    sleep(2)
    "jipeee"
end
pmap(foo, 1:3, on_error=x->-1)
# Worker 2 terminated.ERROR: 
# ProcessExitedException(2)
# Stacktrace:
# ...

# This works, but we don't want to retry:
# pmap(foo, 1:3, on_error=x->-1, retry_delays=zeros(3))
1 Like