Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve.list: NAs introduced by coercion to integer range #729

Open
tyner opened this issue Jun 28, 2024 · 0 comments
Open

resolve.list: NAs introduced by coercion to integer range #729

tyner opened this issue Jun 28, 2024 · 0 comments
Labels

Comments

@tyner
Copy link

tyner commented Jun 28, 2024

Background

I am using s3fs::s3_file_exists which relies on some functionality from future. Not sure whether the problem is in s3fs or future but figured I would start here; if it turns out I am barking up the wrong tree then please accept my apologies and I'll take it up with @DyfanJones

Describe the bug

It mostly works, but occasionally I encounter a warning of the form:

Error in as.list.environment(environment(), all.names = TRUE) :
(converted from warning) NAs introduced by coercion to integer range

Relevant portions from the stack trace when the condition occurs

6: s3fs$file_exists(path)
7: future_vapply(seq_along(s3_parts), function(i) {
retry_api_call(tryCatch({
self$s3_client$head_object(Bucket = s3_parts[[i]]$Bucket, Key = s3_parts[[i]]$Key, VersionId = s3_parts[[i]]
8: future_lapply(X, FUN = function(x, ...) {
value <- x_FUN(x, ...)
if (length(value) != times) {
stopf("values must be length %d, but FUN(X[[ii]]) result is length %d", times, lengt
9: future_xapply(FUN = FUN, nX = nX, chunk_args = X, args = list(...), get_chunk = chunkWith[[, expr = expr, envir = envir, future.envir = future.envir, future.globals = future.globals, future.pac
10: value(fs)
11: value.list(fs)
12: resolve(y, result = TRUE, stdout = stdout, signal = signal, force = TRUE)
13: resolve.list(y, result = TRUE, stdout = stdout, signal = signal, force = TRUE)
14: signalConditionsASAP(obj, resignal = FALSE, pos = ii)
15: signalConditions(obj, exclude = getOption("future.relay.immediate", "immediateCondition"), resignal = resignal, ...)
16: warning(condition)
17: withRestarts({
.Internal(.signalCondition(cond, message, call))
.Internal(.dfltWarn(message, call))
}, muffleWarning = function() NULL)
18: withOneRestart(expr, restarts[[1]])
19: doWithOneRestart(return(expr), restart)

If I enter frame 13 and inspect the first argument, it is a list containing an environment.

Debugging output

If I turn options(future.debug = TRUE) and re-run, the tail end of the debugging output is:

[12:35:03.420] - copied ‘...future.FUN’ to environment
[12:35:03.420] - copied ‘x_FUN’ to environment
[12:35:03.420] - copied ‘times’ to environment
[12:35:03.420] - copied ‘stopf’ to environment
[12:35:03.420] - copied ‘stop_if_not’ to environment
[12:35:03.421] - copied ‘dim’ to environment
[12:35:03.421] - copied ‘valid_types’ to environment
[12:35:03.421] - copied ‘retry_api_call’ to environment
[12:35:03.421] - copied ‘self’ to environment
[12:35:03.421] - copied ‘s3_parts’ to environment
[12:35:03.422] - copied ‘future.call.arguments’ to environment
[12:35:03.422] - copied ‘...future.elements_ii’ to environment
[12:35:03.422] - copied ‘...future.seeds_ii’ to environment
[12:35:03.422] - copied ‘...future.globals.maxSize’ to environment
[12:35:03.422] assign_globals() ... done
[12:35:03.423] plan(): Setting new future strategy stack:
[12:35:03.423] List of future strategies:
[12:35:03.423] 1. sequential:
[12:35:03.423] - args: function (..., envir = parent.frame())
[12:35:03.423] - tweaked: FALSE
[12:35:03.423] - call: NULL
[12:35:03.424] plan(): nbrOfWorkers() = 1
[12:35:03.455] plan(): Setting new future strategy stack:
[12:35:03.455] List of future strategies:
[12:35:03.455] 1. sequential:
[12:35:03.455] - args: function (..., envir = parent.frame())
[12:35:03.455] - tweaked: FALSE
[12:35:03.455] - call: NULL
[12:35:03.455] plan(): nbrOfWorkers() = 1
[12:35:03.456] SequentialFuture started (and completed)
[12:35:03.456] signalConditions() ...
[12:35:03.456] - include = ‘immediateCondition’
[12:35:03.456] - exclude =
[12:35:03.456] - resignal = FALSE
[12:35:03.457] - Number of conditions: 1
[12:35:03.457] signalConditions() ... done
[12:35:03.457] - Launch lazy future ... done
[12:35:03.457] run() for ‘SequentialFuture’ ... done
[12:35:03.457] Created future:
[12:35:03.458] SequentialFuture:
[12:35:03.458] Label: ‘future_vapply-1’
[12:35:03.458] Expression:
[12:35:03.458] {
[12:35:03.458] do.call(function(...) {
[12:35:03.458] ...future.globals.maxSize.org <- getOption("future.globals.maxSize")
[12:35:03.458] if (!identical(...future.globals.maxSize.org, ...future.globals.maxSize)) {
[12:35:03.458] oopts <- options(future.globals.maxSize = ...future.globals.maxSize)
[12:35:03.458] on.exit(options(oopts), add = TRUE)
[12:35:03.458] }
[12:35:03.458] {
[12:35:03.458] lapply(seq_along(...future.elements_ii), FUN = function(jj) {
[12:35:03.458] ...future.X_jj <- ...future.elements_ii[[jj]]
[12:35:03.458] assign(".Random.seed", ...future.seeds_ii[[jj]],
[12:35:03.458] envir = globalenv(), inherits = FALSE)
[12:35:03.458] ...future.FUN(...future.X_jj, ...)
[12:35:03.458] })
[12:35:03.458] }
[12:35:03.458] }, args = future.call.arguments)
[12:35:03.458] }
[12:35:03.458] Lazy evaluation: FALSE
[12:35:03.458] Asynchronous evaluation: FALSE
[12:35:03.458] Local evaluation: TRUE
[12:35:03.458] Environment: 0x4eabf60
[12:35:03.458] Capture standard output: TRUE
[12:35:03.458] Capture condition classes: ‘condition’ (excluding ‘nothing’)
[12:35:03.458] Globals: 14 objects totaling 6.65 MiB (function ‘...future.FUN’ of 21.22 KiB, function ‘x_FUN’ of 33.90 KiB, integer ‘times’ > of 56 bytes, function ‘stopf’ of 26.43 KiB, function ‘stop_if_not’ of 44.12 KiB, ...)
[12:35:03.458] Packages:
[12:35:03.458] L'Ecuyer-CMRG RNG seed: (seed = NULL)
[12:35:03.458] Resolved: TRUE
[12:35:03.458] Value: 56 bytes of class ‘list’
[12:35:03.458] Conditions captured: [n=1] ‘simpleWarning’
[12:35:03.458] Early signaling: FALSE
[12:35:03.458] Owner process: 0b40f994-65e5-eb10-4703-a7af376e8e02
[12:35:03.458] Class: ‘SequentialFuture’, ‘UniprocessFuture’, ‘Future’, ‘environment’
[12:35:03.464] Chunk #1 of 1 ... DONE
[12:35:03.464] Launching 1 futures (chunks) ... DONE
[12:35:03.464] Resolving 1 futures (chunks) ...
[12:35:03.464] resolve() on list ...
[12:35:03.465] recursive: 0
[12:35:03.465] length: 1
[12:35:03.465]
[12:35:03.466] resolved() for ‘SequentialFuture’ ...
[12:35:03.466] - state: ‘finished’
[12:35:03.466] - run: TRUE
[12:35:03.466] - result: ‘FutureResult’
[12:35:03.467] resolved() for ‘SequentialFuture’ ... done
[12:35:03.467] Future #1
[12:35:03.467] signalConditions() ...
[12:35:03.468] - include = ‘immediateCondition’
[12:35:03.468] - exclude =
[12:35:03.468] - resignal = FALSE
[12:35:03.468] - Number of conditions: 1
[12:35:03.469] signalConditions() ... done
[12:35:03.469] signalConditionsASAP(SequentialFuture, pos=1) ...
[12:35:03.469] - nx: 1
[12:35:03.470] - relay: TRUE
[12:35:03.470] - stdout: TRUE
[12:35:03.470] - signal: TRUE
[12:35:03.470] - resignal: FALSE
[12:35:03.470] - force: TRUE
[12:35:03.471] - relayed: [n=1] FALSE
[12:35:03.471] - queued futures: [n=1] FALSE
[12:35:03.471] - until=1
[12:35:03.471] - relaying element #1
[12:35:03.472] signalConditions() ...
[12:35:03.472] - include = ‘immediateCondition’
[12:35:03.472] - exclude =
[12:35:03.473] - resignal = FALSE
[12:35:03.473] - Number of conditions: 1
[12:35:03.473] signalConditions() ... done
[12:35:03.474] signalConditions() ...
[12:35:03.474] - include = ‘immediateCondition’
[12:35:03.474] - exclude =
[12:35:03.474] - resignal = FALSE
[12:35:03.475] - Number of conditions: 1
[12:35:03.475] signalConditions() ... done
[12:35:03.475] signalConditions() ...
[12:35:03.476] - include = ‘condition’
[12:35:03.476] - exclude = ‘immediateCondition’
[12:35:03.476] - resignal = TRUE
[12:35:03.476] - Number of conditions: 1
[12:35:03.477] - Condition #1: ‘simpleWarning’, ‘warning’, ‘condition’
Error in as.list.environment(environment(), all.names = TRUE) :
(converted from warning) NAs introduced by coercion to integer range
[12:35:03.477] signalConditions() ... done
[12:35:03.478] - relayed: [n=1] FALSE
[12:35:03.478] - queued futures: [n=1] TRUE
[12:35:03.478] signalConditionsASAP(SequentialFuture, pos=1) ... done

Not sure if any of that is helpful; happy to post more details as warranted.

Expected behavior

Again, not sure whether the problem is in s3fs or future, but it would be nice to have a more descriptive warning.

Session information

> sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-koji-linux-gnu (64-bit)
Running under: Amazon Linux 2

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

Random number generation:
RNG: L'Ecuyer-CMRG
Normal: Inversion
Sample: Rejection

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] Rcpp_1.0.12 lgr_0.4.4 codetools_0.2-16 listenv_0.9.1 future_1.33.2 digest_0.6.35 crayon_1.5.2 parallelly_1.37.1 paws.common_0.7.3
[10] R6_2.5.1 jsonlite_1.8.8 httr_1.4.7 future.apply_1.11.2 curl_5.2.1 fs_1.6.4 data.table_1.15.4 s3fs_0.1.5 tools_4.0.2
[19] paws.storage_0.6.0 parallel_4.0.2 compiler_4.0.2 globals_0.16.3

> future::futureSessionInfo()

*** Package versions
future 1.33.2, parallelly 1.37.1, parallel 4.0.2, globals 0.16.3, listenv 0.9.1

*** Allocations
availableCores():
system cgroups.cpuset nproc
16 16 16
availableWorkers():
$cgroups.cpuset
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

$nproc
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

$system
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"

*** Settings
- future.plan=
- future.fork.multithreading.enable=
- future.globals.maxSize=
- future.globals.onReference=
- future.resolve.recursive=
- future.rng.onMisuse=
- future.wait.timeout=
- future.wait.interval=
- future.wait.alpha=
- future.startup.script=

*** Backends
Number of workers: 1
List of future strategies:

  1. sequential:
    • args: function (..., envir = parent.frame())
    • tweaked: FALSE
    • call: NULL

*** Basic tests
Main R session details:
pid r sysname release version nodename machine login user effective_user
1 25128 4.0.2 Linux 4.14.232-177.418.amzn2.x86_64 #1 SMP Tue Jun 15 20:57:50 UTC 2021 host001 x86_64 user001 user001 user001
[12:51:12.531] getGlobalsAndPackages() ...
[12:51:12.531] Searching for globals...
[12:51:12.534] - globals found: [9] ‘{’, ‘Sys.sleep’, ‘delay’, ‘data.frame’, ‘ii’, ‘Sys.getpid’, ‘getRversion’, ‘as.list’, ‘Sys.info’
[12:51:12.535] Searching for globals ... DONE
[12:51:12.535] Resolving globals: FALSE
[12:51:12.536] The total size of the 2 globals is 112 bytes (112 bytes)
[12:51:12.536] The total size of the 2 globals exported for future expression (‘{; Sys.sleep(delay); data.frame(worker = ii, pid = Sys.getpid(), r = getRversion(),; as.list(Sys.info())); }’) is 112 bytes.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are two globals: ‘delay’ (56 bytes of class ‘numeric’) and ‘ii’ (56 bytes of class ‘numeric’)
[12:51:12.537] - globals: [2] ‘delay’, ‘ii’
[12:51:12.537]
[12:51:12.537] getGlobalsAndPackages() ... DONE
[12:51:12.538] run() for ‘Future’ ...
[12:51:12.538] - state: ‘created’
[12:51:12.538] - Future backend: ‘FutureStrategy’, ‘sequential’, ‘uniprocess’, ‘future’, ‘function’
[12:51:12.538] - Future class: ‘SequentialFuture’, ‘UniprocessFuture’, ‘Future’, ‘environment’
[12:51:12.539] - Copy elements of temporary ‘SequentialFuture’ to final ‘Future’ object ...
[12:51:12.539] - Field: ‘label’
[12:51:12.539] - Field: ‘local’
[12:51:12.539] - Field: ‘owner’
[12:51:12.539] - Field: ‘envir’
[12:51:12.540] - Field: ‘packages’
[12:51:12.540] - Field: ‘gc’
[12:51:12.540] - Field: ‘conditions’
[12:51:12.540] - Field: ‘expr’
[12:51:12.540] - Field: ‘uuid’
[12:51:12.540] - Field: ‘seed’
[12:51:12.541] - Field: ‘version’
[12:51:12.541] - Field: ‘result’
[12:51:12.541] - Field: ‘asynchronous’
[12:51:12.541] - Field: ‘calls’
[12:51:12.541] - Field: ‘globals’
[12:51:12.541] - Field: ‘stdout’
[12:51:12.542] - Field: ‘earlySignal’
[12:51:12.542] - Field: ‘lazy’
[12:51:12.542] - Field: ‘state’
[12:51:12.542] - Copy elements of temporary ‘SequentialFuture’ to final ‘Future’ object ... done
[12:51:12.542] - Launch lazy future ...
[12:51:12.543] Packages needed by the future expression (n = 0):
[12:51:12.543] Packages needed by future strategies (n = 0):
[12:51:12.544] {
[12:51:12.544] {
[12:51:12.544] {
[12:51:12.544] ...future.startTime <- base::Sys.time()
[12:51:12.544] {
[12:51:12.544] {
[12:51:12.544] {
[12:51:12.544] base::local({
[12:51:12.544] has_future <- base::requireNamespace("future",
[12:51:12.544] quietly = TRUE)
[12:51:12.544] if (has_future) {
[12:51:12.544] ns <- base::getNamespace("future")
[12:51:12.544] version <- ns[[".package"]][["version"]]
[12:51:12.544] if (is.null(version))
[12:51:12.544] version <- utils::packageVersion("future")
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] version <- NULL
[12:51:12.544] }
[12:51:12.544] if (!has_future || version < "1.8.0") {
[12:51:12.544] info <- base::c(r_version = base::gsub("R version ",
[12:51:12.544] "", base::R.version$version.string),
[12:51:12.544] platform = base::sprintf("%s (%s-bit)",
[12:51:12.544] base::R.version$platform, 8 * base::.Machine$sizeof.pointer),
[12:51:12.544] os = base::paste(base::Sys.info()[base::c("sysname",
[12:51:12.544] "release", "version")], collapse = " "),
[12:51:12.544] hostname = base::Sys.info()[["nodename"]])
[12:51:12.544] info <- base::sprintf("%s: %s", base::names(info),
[12:51:12.544] info)
[12:51:12.544] info <- base::paste(info, collapse = "; ")
[12:51:12.544] if (!has_future) {
[12:51:12.544] msg <- base::sprintf("Package 'future' is not installed on worker (%s)",
[12:51:12.544] info)
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s",
[12:51:12.544] info, version)
[12:51:12.544] }
[12:51:12.544] base::stop(msg)
[12:51:12.544] }
[12:51:12.544] })
[12:51:12.544] }
[12:51:12.544] ...future.strategy.old <- future::plan("list")
[12:51:12.544] options(future.plan = NULL)
[12:51:12.544] Sys.unsetenv("R_FUTURE_PLAN")
[12:51:12.544] future::plan("default", .cleanup = FALSE, .init = FALSE)
[12:51:12.544] }
[12:51:12.544] ...future.workdir <- getwd()
[12:51:12.544] }
[12:51:12.544] ...future.oldOptions <- base::as.list(base::.Options)
[12:51:12.544] ...future.oldEnvVars <- base::Sys.getenv()
[12:51:12.544] }
[12:51:12.544] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL,
[12:51:12.544] future.globals.maxSize = NULL, future.globals.method = NULL,
[12:51:12.544] future.globals.onMissing = NULL, future.globals.onReference = NULL,
[12:51:12.544] future.globals.resolve = NULL, future.resolve.recursive = NULL,
[12:51:12.544] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL,
[12:51:12.544] future.stdout.windows.reencode = NULL, width = 200L)
[12:51:12.544] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options),
[12:51:12.544] base::names(...future.oldOptions))
[12:51:12.544] }
[12:51:12.544] if (FALSE) {
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] if (TRUE) {
[12:51:12.544] ...future.stdout <- base::rawConnection(base::raw(0L),
[12:51:12.544] open = "w")
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] ...future.stdout <- base::file(base::switch(.Platform$OS.type,
[12:51:12.544] windows = "NUL", "/dev/null"), open = "w")
[12:51:12.544] }
[12:51:12.544] base::sink(...future.stdout, type = "output", split = FALSE)
[12:51:12.544] base::on.exit(if (!base::is.null(...future.stdout)) {
[12:51:12.544] base::sink(type = "output", split = FALSE)
[12:51:12.544] base::close(...future.stdout)
[12:51:12.544] }, add = TRUE)
[12:51:12.544] }
[12:51:12.544] ...future.frame <- base::sys.nframe()
[12:51:12.544] ...future.conditions <- base::list()
[12:51:12.544] ...future.rng <- base::globalenv()$.Random.seed
[12:51:12.544] if (FALSE) {
[12:51:12.544] ...future.globalenv.names <- c(base::names(base::.GlobalEnv),
[12:51:12.544] "...future.value", "...future.globalenv.names", ".Random.seed")
[12:51:12.544] }
[12:51:12.544] ...future.result <- base::tryCatch({
[12:51:12.544] base::withCallingHandlers({
[12:51:12.544] ...future.value <- base::withVisible(base::local({
[12:51:12.544] Sys.sleep(delay)
[12:51:12.544] data.frame(worker = ii, pid = Sys.getpid(), r = getRversion(),
[12:51:12.544] as.list(Sys.info()))
[12:51:12.544] }))
[12:51:12.544] future::FutureResult(value = ...future.value$value,
[12:51:12.544] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed,
[12:51:12.544] ...future.rng), globalenv = if (FALSE)
[12:51:12.544] list(added = base::setdiff(base::names(base::.GlobalEnv),
[12:51:12.544] ...future.globalenv.names))
[12:51:12.544] else NULL, started = ...future.startTime, version = "1.8")
[12:51:12.544] }, condition = base::local({
[12:51:12.544] c <- base::c
[12:51:12.544] inherits <- base::inherits
[12:51:12.544] invokeRestart <- base::invokeRestart
[12:51:12.544] length <- base::length
[12:51:12.544] list <- base::list
[12:51:12.544] seq.int <- base::seq.int
[12:51:12.544] signalCondition <- base::signalCondition
[12:51:12.544] sys.calls <- base::sys.calls
[12:51:12.544] [[ <- base::[[
[12:51:12.544] + <- base::+
[12:51:12.544] <<- <- base::<<-
[12:51:12.544] sysCalls <- function(calls = sys.calls(), from = 1L) {
[12:51:12.544] calls[seq.int(from = from + 12L, to = length(calls) -
[12:51:12.544] 3L)]
[12:51:12.544] }
[12:51:12.544] function(cond) {
[12:51:12.544] is_error <- inherits(cond, "error")
[12:51:12.544] ignore <- !is_error && !is.null(NULL) && inherits(cond,
[12:51:12.544] NULL)
[12:51:12.544] if (is_error) {
[12:51:12.544] sessionInformation <- function() {
[12:51:12.544] list(r = base::R.Version(), locale = base::Sys.getlocale(),
[12:51:12.544] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(),
[12:51:12.544] search = base::search(), system = base::Sys.info())
[12:51:12.544] }
[12:51:12.544] ...future.conditions[[length(...future.conditions) +
[12:51:12.544] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame),
[12:51:12.544] cond$call), session = sessionInformation(),
[12:51:12.544] timestamp = base::Sys.time(), signaled = 0L)
[12:51:12.544] signalCondition(cond)
[12:51:12.544] }
[12:51:12.544] else if (!ignore && TRUE && inherits(cond, c("condition",
[12:51:12.544] "immediateCondition"))) {
[12:51:12.544] signal <- TRUE && inherits(cond, "immediateCondition")
[12:51:12.544] ...future.conditions[[length(...future.conditions) +
[12:51:12.544] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal))
[12:51:12.544] if (TRUE && !signal) {
[12:51:12.544] muffleCondition <- function (cond, pattern = "^muffle")
[12:51:12.544] {
[12:51:12.544] inherits <- base::inherits
[12:51:12.544] invokeRestart <- base::invokeRestart
[12:51:12.544] is.null <- base::is.null
[12:51:12.544] muffled <- FALSE
[12:51:12.544] if (inherits(cond, "message")) {
[12:51:12.544] muffled <- grepl(pattern, "muffleMessage")
[12:51:12.544] if (muffled)
[12:51:12.544] invokeRestart("muffleMessage")
[12:51:12.544] }
[12:51:12.544] else if (inherits(cond, "warning")) {
[12:51:12.544] muffled <- grepl(pattern, "muffleWarning")
[12:51:12.544] if (muffled)
[12:51:12.544] invokeRestart("muffleWarning")
[12:51:12.544] }
[12:51:12.544] else if (inherits(cond, "condition")) {
[12:51:12.544] if (!is.null(pattern)) {
[12:51:12.544] computeRestarts <- base::computeRestarts
[12:51:12.544] grepl <- base::grepl
[12:51:12.544] restarts <- computeRestarts(cond)
[12:51:12.544] for (restart in restarts) {
[12:51:12.544] name <- restart$name
[12:51:12.544] if (is.null(name))
[12:51:12.544] next
[12:51:12.544] if (!grepl(pattern, name))
[12:51:12.544] next
[12:51:12.544] invokeRestart(restart)
[12:51:12.544] muffled <- TRUE
[12:51:12.544] break
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] invisible(muffled)
[12:51:12.544] }
[12:51:12.544] muffleCondition(cond, pattern = "^muffle")
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] if (TRUE) {
[12:51:12.544] muffleCondition <- function (cond, pattern = "^muffle")
[12:51:12.544] {
[12:51:12.544] inherits <- base::inherits
[12:51:12.544] invokeRestart <- base::invokeRestart
[12:51:12.544] is.null <- base::is.null
[12:51:12.544] muffled <- FALSE
[12:51:12.544] if (inherits(cond, "message")) {
[12:51:12.544] muffled <- grepl(pattern, "muffleMessage")
[12:51:12.544] if (muffled)
[12:51:12.544] invokeRestart("muffleMessage")
[12:51:12.544] }
[12:51:12.544] else if (inherits(cond, "warning")) {
[12:51:12.544] muffled <- grepl(pattern, "muffleWarning")
[12:51:12.544] if (muffled)
[12:51:12.544] invokeRestart("muffleWarning")
[12:51:12.544] }
[12:51:12.544] else if (inherits(cond, "condition")) {
[12:51:12.544] if (!is.null(pattern)) {
[12:51:12.544] computeRestarts <- base::computeRestarts
[12:51:12.544] grepl <- base::grepl
[12:51:12.544] restarts <- computeRestarts(cond)
[12:51:12.544] for (restart in restarts) {
[12:51:12.544] name <- restart$name
[12:51:12.544] if (is.null(name))
[12:51:12.544] next
[12:51:12.544] if (!grepl(pattern, name))
[12:51:12.544] next
[12:51:12.544] invokeRestart(restart)
[12:51:12.544] muffled <- TRUE
[12:51:12.544] break
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] invisible(muffled)
[12:51:12.544] }
[12:51:12.544] muffleCondition(cond, pattern = "^muffle")
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] }))
[12:51:12.544] }, error = function(ex) {
[12:51:12.544] base::structure(base::list(value = NULL, visible = NULL,
[12:51:12.544] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed,
[12:51:12.544] ...future.rng), started = ...future.startTime,
[12:51:12.544] finished = Sys.time(), session_uuid = NA_character_,
[12:51:12.544] version = "1.8"), class = "FutureResult")
[12:51:12.544] }, finally = {
[12:51:12.544] if (!identical(...future.workdir, getwd()))
[12:51:12.544] setwd(...future.workdir)
[12:51:12.544] {
[12:51:12.544] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) {
[12:51:12.544] ...future.oldOptions$nwarnings <- NULL
[12:51:12.544] }
[12:51:12.544] base::options(...future.oldOptions)
[12:51:12.544] if (.Platform$OS.type == "windows") {
[12:51:12.544] old_names <- names(...future.oldEnvVars)
[12:51:12.544] envs <- base::Sys.getenv()
[12:51:12.544] names <- names(envs)
[12:51:12.544] common <- intersect(names, old_names)
[12:51:12.544] added <- setdiff(names, old_names)
[12:51:12.544] removed <- setdiff(old_names, names)
[12:51:12.544] changed <- common[...future.oldEnvVars[common] !=
[12:51:12.544] envs[common]]
[12:51:12.544] NAMES <- toupper(changed)
[12:51:12.544] args <- list()
[12:51:12.544] for (kk in seq_along(NAMES)) {
[12:51:12.544] name <- changed[[kk]]
[12:51:12.544] NAME <- NAMES[[kk]]
[12:51:12.544] if (name != NAME && is.element(NAME, old_names))
[12:51:12.544] next
[12:51:12.544] args[[name]] <- ...future.oldEnvVars[[name]]
[12:51:12.544] }
[12:51:12.544] NAMES <- toupper(added)
[12:51:12.544] for (kk in seq_along(NAMES)) {
[12:51:12.544] name <- added[[kk]]
[12:51:12.544] NAME <- NAMES[[kk]]
[12:51:12.544] if (name != NAME && is.element(NAME, old_names))
[12:51:12.544] next
[12:51:12.544] args[[name]] <- ""
[12:51:12.544] }
[12:51:12.544] NAMES <- toupper(removed)
[12:51:12.544] for (kk in seq_along(NAMES)) {
[12:51:12.544] name <- removed[[kk]]
[12:51:12.544] NAME <- NAMES[[kk]]
[12:51:12.544] if (name != NAME && is.element(NAME, old_names))
[12:51:12.544] next
[12:51:12.544] args[[name]] <- ...future.oldEnvVars[[name]]
[12:51:12.544] }
[12:51:12.544] if (length(args) > 0)
[12:51:12.544] base::do.call(base::Sys.setenv, args = args)
[12:51:12.544] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars))
[12:51:12.544] }
[12:51:12.544] {
[12:51:12.544] if (base::length(...future.futureOptionsAdded) >
[12:51:12.544] 0L) {
[12:51:12.544] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded))
[12:51:12.544] base::names(opts) <- ...future.futureOptionsAdded
[12:51:12.544] base::options(opts)
[12:51:12.544] }
[12:51:12.544] {
[12:51:12.544] {
[12:51:12.544] base::assign(".Random.seed", c(10407L, 852045503L,
[12:51:12.544] 1098400933L, 382416171L, -1498524018L, 1218928538L,
[12:51:12.544] -1971240002L), envir = base::globalenv(),
[12:51:12.544] inherits = FALSE)
[12:51:12.544] NULL
[12:51:12.544] }
[12:51:12.544] options(future.plan = NULL)
[12:51:12.544] if (is.na(NA_character_))
[12:51:12.544] Sys.unsetenv("R_FUTURE_PLAN")
[12:51:12.544] else Sys.setenv(R_FUTURE_PLAN = NA_character_)
[12:51:12.544] future::plan(...future.strategy.old, .cleanup = FALSE,
[12:51:12.544] .init = FALSE)
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] }
[12:51:12.544] })
[12:51:12.544] if (TRUE) {
[12:51:12.544] base::sink(type = "output", split = FALSE)
[12:51:12.544] if (TRUE) {
[12:51:12.544] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout))
[12:51:12.544] }
[12:51:12.544] else {
[12:51:12.544] ...future.result["stdout"] <- base::list(NULL)
[12:51:12.544] }
[12:51:12.544] base::close(...future.stdout)
[12:51:12.544] ...future.stdout <- NULL
[12:51:12.544] }
[12:51:12.544] ...future.result$conditions <- ...future.conditions
[12:51:12.544] ...future.result$finished <- base::Sys.time()
[12:51:12.544] ...future.result
[12:51:12.544] }
[12:51:12.548] assign_globals() ...
[12:51:12.548] List of 2
[12:51:12.548] $ delay: num 1
[12:51:12.548] $ ii : int 1
[12:51:12.548] - attr(, "where")=List of 2
[12:51:12.548] ..$ delay:<environment: R_EmptyEnv>
[12:51:12.548] ..$ ii :<environment: R_EmptyEnv>
[12:51:12.548] - attr(
, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
[12:51:12.548] - attr(, "resolved")= logi FALSE
[12:51:12.548] - attr(
, "total_size")= num 112
[12:51:12.548] - attr(*, "already-done")= logi TRUE
[12:51:12.554] - copied ‘delay’ to environment
[12:51:12.554] - copied ‘ii’ to environment
[12:51:12.554] assign_globals() ... done
[12:51:12.561] plan(): Setting new future strategy stack:
[12:51:12.561] List of future strategies:
[12:51:12.561] 1. sequential:
[12:51:12.561] - args: function (..., envir = parent.frame())
[12:51:12.561] - tweaked: FALSE
[12:51:12.561] - call: NULL
[12:51:12.562] plan(): nbrOfWorkers() = 1
[12:51:13.567] plan(): Setting new future strategy stack:
[12:51:13.567] List of future strategies:
[12:51:13.567] 1. sequential:
[12:51:13.567] - args: function (..., envir = parent.frame())
[12:51:13.567] - tweaked: FALSE
[12:51:13.567] - call: NULL
[12:51:13.568] plan(): nbrOfWorkers() = 1
[12:51:13.569] SequentialFuture started (and completed)
[12:51:13.569] - Launch lazy future ... done
[12:51:13.570] run() for ‘SequentialFuture’ ... done
[12:51:13.570] resolve() on list ...
[12:51:13.570] recursive: 0
[12:51:13.570] length: 1
[12:51:13.571]
[12:51:13.571] resolved() for ‘SequentialFuture’ ...
[12:51:13.571] - state: ‘finished’
[12:51:13.572] - run: TRUE
[12:51:13.572] - result: ‘FutureResult’
[12:51:13.572] resolved() for ‘SequentialFuture’ ... done
[12:51:13.572] Future #1
[12:51:13.573] signalConditionsASAP(SequentialFuture, pos=1) ...
[12:51:13.573] - nx: 1
[12:51:13.573] - relay: TRUE
[12:51:13.574] - stdout: TRUE
[12:51:13.574] - signal: TRUE
[12:51:13.574] - resignal: FALSE
[12:51:13.574] - force: TRUE
[12:51:13.574] - relayed: [n=1] FALSE
[12:51:13.575] - queued futures: [n=1] FALSE
[12:51:13.575] - until=1
[12:51:13.575] - relaying element #1
[12:51:13.575] - relayed: [n=1] TRUE
[12:51:13.576] - queued futures: [n=1] TRUE
[12:51:13.576] signalConditionsASAP(SequentialFuture, pos=1) ... done
[12:51:13.576] length: 0 (resolved future 1)
[12:51:13.576] Relaying remaining futures
[12:51:13.576] signalConditionsASAP(NULL, pos=0) ...
[12:51:13.576] - nx: 1
[12:51:13.577] - relay: TRUE
[12:51:13.577] - stdout: TRUE
[12:51:13.577] - signal: TRUE
[12:51:13.577] - resignal: FALSE
[12:51:13.577] - force: TRUE
[12:51:13.578] - relayed: [n=1] TRUE
[12:51:13.578] - queued futures: [n=1] TRUE
- flush all
[12:51:13.578] - relayed: [n=1] TRUE
[12:51:13.578] - queued futures: [n=1] TRUE
[12:51:13.578] signalConditionsASAP(NULL, pos=0) ... done
[12:51:13.578] resolve() on list ... DONE
Worker R session details:
worker pid r sysname release version nodename machine login user effective_user
1 1 25128 4.0.2 Linux 4.14.232-177.418.amzn2.x86_64 #1 SMP Tue Jun 15 20:57:50 UTC 2021 host001 x86_64 user001 user001 user001
Number of unique worker PIDs: 1 (as expected)

@tyner tyner added the bug label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant