futureverse / futureverse/future

Set future state to "failed" on orchestration errors?

Open
#671 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
1k
Forks
92
PR merge metrics
No merged PRs in 30d

Description

For example,

```r
library(future)
plan(multicore)
f <- future(tools::pskill(pid = Sys.getpid()))
r <- result(f)
# Error: Failed to retrieve the result of MulticoreFuture () from the
# forked worker (on localhost; PID 1136927). Post-mortem diagnostic: No process
# exists with this PID, i.e. the forked localhost worker is no longer alive
```

```r
> r <- tryCatch(result(f), error = identity)
> class(r)
[1] "FutureError" "error" "FutureCondition" "condition"
```

```r
> f$state
[1] "running"
```

# Suggestion

When there is a non-recoverable FutureError, set the state of the future to `"failed"`. This can then be used to prevent further attempts to retrieve the `result()`. OTH, this requires that we know the problem cannot be recovered from. For instance, if it's due to a temporary communication issue, it might work when we call `result(f)` at a later stage.

# See also

This is related to Issue #667.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.