Skip to content

Commit 793d2e4

Browse files
Merge branch 'release/1.67.0'
2 parents 71201b5 + 7be8d98 commit 793d2e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2818
-1406
lines changed

.github/workflows/future_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- { plan: 'future.batchtools::batchtools_bash' }
2525
- { plan: 'future.callr::callr' }
2626
- { plan: 'future.mirai::mirai_multisession' }
27-
- { plan: 'future.mirai::mirai_cluster' }
27+
# - { plan: 'future.mirai::mirai_cluster' }
2828

2929
env:
3030
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

DESCRIPTION

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.58.0
2+
Version: 1.67.0
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)
@@ -45,3 +45,75 @@ Language: en-US
4545
Encoding: UTF-8
4646
RoxygenNote: 7.3.2
4747
Roxygen: list(markdown = TRUE)
48+
Collate:
49+
'000.bquote.R'
50+
'000.import.R'
51+
'000.re-exports.R'
52+
'010.tweakable.R'
53+
'010.utils-parallelly.R'
54+
'backend_api-01-FutureBackend-class.R'
55+
'backend_api-03.MultiprocessFutureBackend-class.R'
56+
'backend_api-11.ClusterFutureBackend-class.R'
57+
'backend_api-11.MulticoreFutureBackend-class.R'
58+
'backend_api-11.SequentialFutureBackend-class.R'
59+
'backend_api-13.MultisessionFutureBackend-class.R'
60+
'backend_api-ConstantFuture-class.R'
61+
'backend_api-Future-class.R'
62+
'backend_api-FutureRegistry.R'
63+
'backend_api-UniprocessFuture-class.R'
64+
'backend_api-evalFuture.R'
65+
'core_api-cancel.R'
66+
'core_api-future.R'
67+
'core_api-reset.R'
68+
'core_api-resolved.R'
69+
'core_api-value.R'
70+
'delayed_api-futureAssign.R'
71+
'delayed_api-futureOf.R'
72+
'demo_api-mandelbrot.R'
73+
'infix_api-01-futureAssign_OP.R'
74+
'infix_api-02-globals_OP.R'
75+
'infix_api-03-seed_OP.R'
76+
'infix_api-04-stdout_OP.R'
77+
'infix_api-05-conditions_OP.R'
78+
'infix_api-06-lazy_OP.R'
79+
'infix_api-07-label_OP.R'
80+
'infix_api-08-plan_OP.R'
81+
'infix_api-09-tweak_OP.R'
82+
'protected_api-FutureCondition-class.R'
83+
'protected_api-FutureGlobals-class.R'
84+
'protected_api-FutureResult-class.R'
85+
'protected_api-futures.R'
86+
'protected_api-globals.R'
87+
'protected_api-journal.R'
88+
'protected_api-resolve.R'
89+
'protected_api-signalConditions.R'
90+
'testme.R'
91+
'utils-basic.R'
92+
'utils-conditions.R'
93+
'utils-connections.R'
94+
'utils-debug.R'
95+
'utils-immediateCondition.R'
96+
'utils-marshalling.R'
97+
'utils-objectSize.R'
98+
'utils-options.R'
99+
'utils-prune_pkg_code.R'
100+
'utils-registerClusterTypes.R'
101+
'utils-rng_utils.R'
102+
'utils-signalEarly.R'
103+
'utils-stealth_sample.R'
104+
'utils-sticky_globals.R'
105+
'utils-tweakExpression.R'
106+
'utils-uuid.R'
107+
'utils-whichIndex.R'
108+
'utils_api-backtrace.R'
109+
'utils_api-capture_journals.R'
110+
'utils_api-futureCall.R'
111+
'utils_api-futureSessionInfo.R'
112+
'utils_api-makeClusterFuture.R'
113+
'utils_api-minifuture.R'
114+
'utils_api-nbrOfWorkers.R'
115+
'utils_api-plan.R'
116+
'utils_api-plan-with.R'
117+
'utils_api-sessionDetails.R'
118+
'utils_api-tweak.R'
119+
'zzz.R'

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ importFrom(listenv,listenv)
227227
importFrom(listenv,mapping)
228228
importFrom(listenv,parse_env_subset)
229229
importFrom(parallel,clusterCall)
230+
importFrom(parallel,clusterEvalQ)
230231
importFrom(parallel,nextRNGStream)
231232
importFrom(parallel,nextRNGSubStream)
232233
importFrom(parallel,stopCluster)

NEWS.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
# Version 1.67.0 [2025-07-29]
2+
3+
This is the fourth 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 future
7+
1.40.0 (2025-04-10).
8+
9+
## Significant Changes
10+
11+
* Now argument `workers` for `plan(multisession)` defaults to
12+
`availableCores(constraints = "connections-16")`. This will make
13+
the default for `plan(multisession)` work also on computers with a
14+
large number of CPU cores (e.g. 192 and 256 cores) while leaving 16
15+
connection slots available for other needs.
16+
17+
* Futures now muffle any `packageStartupMessage` conditions produced
18+
when pre-loading and pre-attaching packages, e.g. as specified by
19+
the `packages` argument or those needed by global objects.
20+
21+
## Performance
22+
23+
* The pre-validation of the cluster worker allotted to a future when
24+
launched was unnecessarily expensive due to a thinko since
25+
**future** 1.40.0 (2025-04-10), e.g. it would take ~0.1-0.2 seconds
26+
for a multisession future, whereas after the fix it is effectly 0.0
27+
seconds.
28+
29+
* Calling `resolved()` on a lazy `ClusterFuture` would collect the
30+
result for the first _resolved_ future in order to free up one
31+
worker slot. Now this is only done if all slots are occupied. The
32+
net benefit is that lazy cluster futures will be launched faster,
33+
unless all workers are busy.
34+
35+
* Cluster and multisession workers initiate more things when created,
36+
e.g. pre-loading of packages and memoization of available
37+
cores. Previously, such steps were performed only when the first
38+
future was evaluated on a worker.
39+
40+
## Bug Fixes
41+
42+
* If a multicore future that was terminated abruptly (e.g. via
43+
`tools::pskill()` or by the operating system), then it was not
44+
detected as such. Instead it resulted in an unexpected error that
45+
could not be recovered from. Now it is detected and a
46+
`FutureInterruptError` is signaled, which can then be handled and
47+
the future may be `reset()`.
48+
49+
* Calls to `resolved()` were not registered by FutureJournal.
50+
51+
* Future backend factory was created via the calling environment
52+
rather than via the namespace environment where it lives.
53+
54+
155
# Version 1.58.0 [2025-06-05]
256

357
This is the third rollout out of several towards a near-future major

R/backend_api-01-FutureBackend-class.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#' The `FutureBackend` class specifies FutureBackend API,
4949
#' that all backends must implement and comply to. Specifically,
5050
#'
51+
#' @name FutureBackend-class
5152
#' @keywords internal
5253
#' @export
5354
FutureBackend <- function(..., earlySignal = FALSE, gc = FALSE, maxSizeOfObjects = getOption("future.globals.maxSize", +Inf), interrupts = TRUE, hooks = FALSE) {
@@ -175,7 +176,7 @@ print.FutureBackend <- function(x, ...) {
175176
#' @return
176177
#' `launchFuture()` returns the launched `Future` object.
177178
#'
178-
#' @rdname FutureBackend
179+
#' @rdname FutureBackend-class
179180
#' @export
180181
launchFuture <- function(backend, future, ...) {
181182
UseMethod("launchFuture")
@@ -188,7 +189,7 @@ launchFuture.FutureBackend <- function(backend, future, ...) {
188189

189190

190191
#'
191-
#' @rdname FutureBackend
192+
#' @rdname FutureBackend-class
192193
#' @export
193194
listFutures <- function(backend, ...) {
194195
UseMethod("listFutures")
@@ -212,7 +213,7 @@ listFutures.FutureBackend <- function(backend, ...) {
212213
#' `interruptFuture()` returns the interrupted `Future` object,
213214
#' if supported, other the unmodified future.
214215
#'
215-
#' @rdname FutureBackend
216+
#' @rdname FutureBackend-class
216217
#' @export
217218
interruptFuture <- function(backend, future, ...) {
218219
UseMethod("interruptFuture")
@@ -278,7 +279,7 @@ makeFutureBackend <- function(evaluator, ..., debug = FALSE) {
278279
mdebugf("Backend factory arguments: [n=%d]", length(args2))
279280
mstr(args2)
280281
}
281-
backend <- do.call(factory, args = args)
282+
backend <- do.call(factory, args = args, envir = environment(factory))
282283
if (debug) mdebugf("Backend: <%s>", commaq(class(backend)))
283284
stop_if_not(inherits(backend, "FutureBackend"))
284285

@@ -290,7 +291,7 @@ makeFutureBackend <- function(evaluator, ..., debug = FALSE) {
290291

291292

292293

293-
#' @rdname FutureBackend
294+
#' @rdname FutureBackend-class
294295
#' @export
295296
validateFutureGlobals <- function(backend, future, ...) {
296297
UseMethod("validateFutureGlobals")
@@ -372,7 +373,7 @@ getFutureBackendConfigs.Future <- function(future, ...) {
372373
#' `stopWorkers()` returns TRUE if the workers were shut down,
373374
#' otherwise FALSE.
374375
#'
375-
#' @rdname FutureBackend
376+
#' @rdname FutureBackend-class
376377
#' @export
377378
stopWorkers <- function(backend, ...) {
378379
UseMethod("stopWorkers")

R/backend_api-03.MultiprocessFutureBackend-class.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @inheritParams FutureBackend
1+
#' @inheritParams FutureBackend-class
22
#'
33
#' @param wait.timeout Number of seconds before timing out.
44
#'
@@ -8,7 +8,7 @@
88
#' attempt.
99
#'
1010
#' @keywords internal
11-
#' @rdname FutureBackend
11+
#' @rdname FutureBackend-class
1212
#'
1313
#' @export
1414
MultiprocessFutureBackend <- function(..., wait.timeout = getOption("future.wait.timeout", 24 * 60 * 60), wait.interval = getOption("future.wait.interval", 0.01), wait.alpha = getOption("future.wait.alpha", 1.01)) {
@@ -92,7 +92,7 @@ nbrOfFreeWorkers.MultiprocessFutureBackend <- function(evaluator, background = F
9292

9393

9494

95-
#' A multiprocess future is a future whose value will be resolved asynchronously in a parallel process
95+
D#' A multiprocess future is a future whose value will be resolved asynchronously in a parallel process
9696
#'
9797
#' @inheritParams Future-class
9898
#'

0 commit comments

Comments
 (0)