Skip to content

BUG FIX: Release FutureRegistry slot on ClusterFuture FutureLaunchError when resolved() precedes value() - #851

Open
chenyangsu wants to merge 1 commit into
futureverse:developfrom
chenyangsu:fix/cluster-launch-error-registry-leak
Open

chenyangsu wants to merge 1 commit into
futureverse:developfrom
chenyangsu:fix/cluster-launch-error-registry-leak

Conversation

@chenyangsu

Copy link
Copy Markdown

With plan(multisession, workers = 2), polling resolved(f) before value(f) (or calling value(list(f))) on a FutureLaunchError leaves nbrOfFreeWorkers() at 1L instead of 2L. receiveMessageFromWorker() stores future[["result"]] without removing the future from FutureRegistry, and result.ClusterFuture() then throws early before its removal step.

Removing the future from FutureRegistry in receiveMessageFromWorker() (matching FutureResult handling and commit d5f2d26f for multicore) and guarding removal in result.ClusterFuture() releases the slot. Happy to move cleanup into result.ClusterFuture() if you prefer.

Testing: Rscript on tests/test-cluster-launch-error-registry.R, test-cluster-missing-future-pkg.R, test-cluster,worker-termination.R, test-value-lazy-launch-error.R, test-FutureRegistry.R -> 5 passed (0 failed).

@HenrikBengtsson HenrikBengtsson added this to the Next release milestone Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants