Skip to content

Commit d03e044

Browse files
BUG FIX: R_FUTURE_PLAN=multisession in Renviron would launch a 'fork bomb' [#806]
1 parent 13815e4 commit d03e044

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.67.0-9006
2+
Version: 1.67.0-9007
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

NEWS.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
# Version (development version)
22

3+
This is the fifth rollout out of several towards a near-future major
4+
release. This has been made possible due to a multi-year effort of
5+
internal re-designs, work with package maintainers, release, and
6+
repeat. This release fixes a few more regressions introduced in
7+
**future** 1.40.0 (2025-04-10) and 1.67.0 (2025-07-29).
8+
39
## Bug Fixes
410

511
* The `cluster` backend failed when used with an `MPIcluster` as
612
created by `parallel::makeCluster(..., type = "MPI")`. This bug was
713
introduced in **future** (>= 1.40.0) [2025-04-10].
814

15+
* Setting `R_FUTURE_PLAN=multisession` in an Renviron file, or a
16+
shell startup script, would result in a "fork bomb" when loading
17+
the **future** package. This happened because the setup of the
18+
future backend happened eagerly when the **future** package was
19+
loaded instead of being deferred to when the first future launched.
20+
This resulted in new, nested R workers being created recursively,
21+
until the machine ran out of resources. This bug was introduced in
22+
**future** (>= 1.67.0) [2025-07-29].
23+
924

1025
# Version 1.67.0 [2025-07-29]
1126

1227
This is the fourth rollout out of several towards a near-future major
1328
release. This has been made possible due to a multi-year effort of
1429
internal re-designs, work with package maintainers, release, and
15-
repeat. This release fixes a few more regressions introduced in future
16-
1.40.0 (2025-04-10).
30+
repeat. This release fixes a few more regressions introduced in
31+
**future** 1.40.0 (2025-04-10).
1732

1833
## Significant Changes
1934

@@ -66,9 +81,9 @@ repeat. This release fixes a few more regressions introduced in future
6681
This is the third rollout out of several towards a near-future major
6782
release that I am really excited about. This has been made possible
6883
due to a multi-year effort of internal re-designs, work with package
69-
maintainers, release, and repeat. This release fixes a few
70-
regressions introduced in future 1.40.0 (2025-04-10), despite passing
71-
[all unit, regression, and system
84+
maintainers, release, and repeat. This release fixes a few regressions
85+
introduced in **future** 1.40.0 (2025-04-10), despite passing [all
86+
unit, regression, and system
7287
tests](https://www.futureverse.org/quality.html).
7388

7489
## New Features
@@ -142,8 +157,8 @@ tests](https://www.futureverse.org/quality.html).
142157
This is the second rollout out of three-four major updates, which is
143158
now possible due to a multi-year effort of internal re-designs, work
144159
with package maintainers, release, and repeat. This release fixes two
145-
regressions introduced in future 1.40.0 (2025-04-10), despite passing
146-
[all unit, regression, and system
160+
regressions introduced in **future** 1.40.0 (2025-04-10), despite
161+
passing [all unit, regression, and system
147162
tests](https://www.futureverse.org/quality.html) of the Future API
148163
that we have built up over the years. On the upside, fixing these
149164
issues led to a greatly improved static-code analyzer for

R/utils_api-plan.R

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -511,19 +511,21 @@ plan <- local({
511511
} ## if (init)
512512

513513
## Initiate future workers?
514-
if (init) stack[[1]] <<- plan_init(stack[[1]], debug = debug)
515-
516-
## Sanity checks
517-
with_assert({
518-
nbrOfWorkers <- nbrOfWorkers()
519-
if (debug) mdebugf(sprintf("plan(): nbrOfWorkers() = %.0f", nbrOfWorkers))
520-
521-
stop_if_not(
522-
is.numeric(nbrOfWorkers), length(nbrOfWorkers) == 1L,
523-
!is.na(nbrOfWorkers), nbrOfWorkers >= 1L
524-
)
525-
})
526-
514+
if (init) {
515+
stack[[1]] <<- plan_init(stack[[1]], debug = debug)
516+
517+
## Sanity checks
518+
with_assert({
519+
nbrOfWorkers <- nbrOfWorkers()
520+
if (debug) mdebugf(sprintf("plan(): nbrOfWorkers() = %.0f", nbrOfWorkers))
521+
522+
stop_if_not(
523+
is.numeric(nbrOfWorkers), length(nbrOfWorkers) == 1L,
524+
!is.na(nbrOfWorkers), nbrOfWorkers >= 1L
525+
)
526+
})
527+
}
528+
527529
invisible(oldStack)
528530
} ## plan_set()
529531

0 commit comments

Comments
 (0)