listFutures() did not list the active futures of the backend.
Waiting for an available worker with a timeout greater than 60 seconds could take much longer than that.
When waiting for an available worker, the callr backend used the
current values of R options future.wait.timeout,
future.wait.interval, and future.wait.alpha, instead of the
ones recorded when the backend was set up via plan(). Also, the
fallback interval was 0.2 seconds instead of 0.01 seconds.
help("callr") that callr futures always discard
standard error (stderr).Launching too many callr futures without removing them after they've been resolved could result in errors on "processx socketpair (system error 24, Too many open files) unix/processx.c:433 (processx__make_socketpair)".
The sys.calls() stack it a 'callr' worker would carry the full
future content, which would result in a deparsed call stacks to be
unnecessarily large.
Use r_process$cleanup() instead of r_process$finalize() to
align with callr updates.
Remove unused CallrFutureError().
Adjust internal code on how to best clean up callr processes.
resolved() for callr futures could throw a FutureError in some
cases, e.g. a FutureInterruptError if the future was terminated
abruptly.Now 'callr' futures can be canceled using cancel(), which also
interrupts them by default, which in turn frees up compute
resources sooner. Map-reduce API such as future.apply,
doFuture, and furrr can take advantage of this by
canceling all non-resolved futures whenever they detect an error
in one of the futures. Also, canceled futures can be reset()
and thereafter relaunched, possibly on another future backend.
A future that failed due to the 'callr' worker process being
terminated is now considered interrupted, which for instance means
that it can be reset().
Now 'callr' futures relay immediateCondition:s in near real-time,
e.g. progression conditions signals by the progressr package.
run() for CallrFuture would update the RNG state, because
callr::r_bg(), used to launch the future, does so. This would
compromise numeric reproducibility, where the callr future
backend would not give the same random numbers as other future
backends. Now run() launches the future in stealth RNG mode,
i.e. gives r_bg() a semi-random initial seed to work with (by
removing .Random.seed) and then undoes the RNG state at the very
end.Now resolved() supports early signaling.
Now result() and value() gives a slightly more informative
error message in case the callr process failed with a non-zero
exit code.
Add option to configure callr futures to be "supervised" by the
callr package when setting up the plan, i.e. plan(callr, supervise = TRUE).
Now callr-specific orchestration errors are of class
CallrFutureError, which provides information also on the future
that failed.
await(), which was used for internal
purposes.nbrOfFreeWorkers().await(), which was used for internal
purposes.resolved() for CallrFuture will launch lazy futures [future
(>= 1.15.0)].top) via a dummy --future-label="<label>" argument in the
callr system call.plan(callr, workers) where workers being a function would
result in an error when a future was created.plan(list(callr, callr)) the second layer of futures
would use the same number of workers as the first layer.Argument workers of future strategies may now also be a function,
which is called without argument when the future strategy is set up
and used as is. For instance, plan(callr, workers = halfCores)
where halfCores <- function() { max(1, round(availableCores() / 2)) } will use half of the number of available cores. This is
useful when using nested future strategies with remote machines.
Gathering of results from background processes is made a little bit more robust against slow file systems by retrying a few times before accepting an error as an error.
future.wait.timeout.FutureError where applicable.plan(callr, workers = n) was not respected.plan(callr) or plan(callr, workers = 4L).