Skip to content

Commit 53a9b1a

Browse files
Produce only interrupt warning on interrupts; happened also on errors
1 parent 79c4c69 commit 53a9b1a

4 files changed

Lines changed: 12 additions & 16 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.apply
2-
Version: 1.11.3-9013
2+
Version: 1.11.3-9014
33
Title: Apply Function to Elements in Parallel using Futures
44
Depends:
55
R (>= 3.2.0),

NEWS.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
requires. Use of a string has been deprecated since
2525
**future.apply** 1.10.0 (2022-11-04).
2626

27-
* Use of `...` as global variables is now considered a mistake. For
28-
example, instead of `f <- function(X, ...) future_lapply(X,
29-
function(x) sum(x, ...))`, use `f <- function(X, ...)
30-
future_lapply(X, function(x, ...) sum(x, ...), ...)` such that
31-
`...` is passed as arguments.
32-
3327

3428
# Version 1.11.3 [2024-10-27]
3529

R/future_lapply.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ future_lapply <- local({
209209
expr_FUN <- quote({
210210
...future.FUN(...future.X_jj)
211211
})
212-
if (debug) mdebugf(" => Will not pass '...' to FUN(): %s", deparse(expr_FUN))
212+
if (debug) mdebugf(" => Will not pass '...' to FUN(): %s", commaq(deparse(expr_FUN)))
213213
} else {
214214
## No; okay to pass '...' to FUN()
215215
expr_FUN <- quote({
216216
...future.FUN(...future.X_jj, ...)
217217
})
218-
if (debug) mdebugf(" => Will pass '...' to FUN(): %s", deparse(expr_FUN))
218+
if (debug) mdebugf(" => Will pass '...' to FUN(): %s", commaq(deparse(expr_FUN)))
219219
}
220220

221221
## With or without RNG?

R/future_xapply.R

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,20 @@ future_xapply <- local({
300300
}) ## withCallingHandlers()
301301
} else {
302302
## value() exits early if it detects a future with an error.
303-
## In future (> 1.42.0), non-resolved futures will be automatically
304-
## interrupted if there's an error.
303+
## In future (> 1.40.0), non-resolved futures will be automatically
304+
## canceled if there's an error.
305305
value(fs)
306306
}
307307
}, interrupt = identity, error = identity) ## tryCatch()
308308

309309
if (inherits(values, "interrupt") || inherits(values, "error")) {
310-
when <- Sys.time()
311-
host <- Sys.info()[["nodename"]]
312-
pid <- Sys.getpid()
313-
msg <- sprintf("%s() interrupted at %s, while running on %s (pid %s)", fcn_name, format(when, format = "%FT%T"), sQuote(host), pid)
314-
warning(sprintf("%s. Cleaning up ...", msg), immediate. = TRUE, call. = FALSE)
310+
if (inherits(values, "interrupt")) {
311+
when <- Sys.time()
312+
host <- Sys.info()[["nodename"]]
313+
pid <- Sys.getpid()
314+
msg <- sprintf("%s() interrupted at %s, while running on %s (pid %s)", fcn_name, format(when, format = "%FT%T"), sQuote(host), pid)
315+
warning(sprintf("%s. Cleaning up ...", msg), immediate. = TRUE, call. = FALSE)
316+
}
315317

316318
## Interrupt all futures
317319
fs <- cancel(fs)

0 commit comments

Comments
 (0)