From ce97b7ec3188ebf8285b5660559c78c1f29fede7 Mon Sep 17 00:00:00 2001 From: Henrik Bengtsson Date: Tue, 28 Jan 2025 10:00:22 -0800 Subject: [PATCH] =?UTF-8?q?BUG=20FIX:=20Call=20`isNodeAlive()`=20and=20`ki?= =?UTF-8?q?llNode()`=20on=20cluster=20nodes=20running=20on=20external=20ma?= =?UTF-8?q?chines=20would=20produce=20`Error:=20=E2=80=98length(rsh=5Fcall?= =?UTF-8?q?)=20=3D=3D=201L=E2=80=99=20is=20not=20TRUE`=20if=20options=20`r?= =?UTF-8?q?shopts`=20were=20specified=20during=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DESCRIPTION | 2 +- NEWS.md | 6 +++++- R/isNodeAlive.R | 1 + R/killNode.R | 1 + README.md | 5 +++++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5d62f89..cc3eb56 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: parallelly -Version: 1.41.0-9010 +Version: 1.41.0-9011 Title: Enhancing the 'parallel' Package Imports: parallel, diff --git a/NEWS.md b/NEWS.md index 57d9a7a..162466b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,7 +13,11 @@ known_types, several.ok = FALSE) : 'arg' must be of length 1`. This bug was introduced in version 1.38.0 (2024-07-27), when adding richer support for the `rscript_sh` argument. - + + * Call `isNodeAlive()` and `killNode()` on cluster nodes running on + external machines would produce `Error: ‘length(rsh_call) == 1L’ is + not TRUE` if options `rshopts` were specified during creation. + * The value of `availableCores()` was numeric rather than integer as documented. This harmless bug was introduced in version 1.31.0 (2022-04-07). diff --git a/R/isNodeAlive.R b/R/isNodeAlive.R index 746af25..d70dc9a 100644 --- a/R/isNodeAlive.R +++ b/R/isNodeAlive.R @@ -106,6 +106,7 @@ isNodeAlive.RichSOCKnode <- function(x, timeout = 0.0, ...) { rshopts <- args_org$rshopts if (length(args_org$user) == 1L) rshopts <- c("-l", args_org$user, rshopts) + rshopts <- paste(rshopts, collapse = " ") rsh_call <- paste(paste(shQuote(rshcmd), collapse = " "), rshopts, worker) debug && mdebugf("- Command to connect to the other host: %s", rsh_call) stop_if_not(length(rsh_call) == 1L) diff --git a/R/killNode.R b/R/killNode.R index cb206f1..def923e 100644 --- a/R/killNode.R +++ b/R/killNode.R @@ -138,6 +138,7 @@ killNode.RichSOCKnode <- function(x, signal = tools::SIGTERM, timeout = 0.0, ... rshopts <- args_org$rshopts if (length(args_org$user) == 1L) rshopts <- c("-l", args_org$user, rshopts) + rshopts <- paste(rshopts, collapse = " ") rsh_call <- paste(paste(shQuote(rshcmd), collapse = " "), rshopts, worker) debug && mdebugf("- Command to connect to the other host: %s", rsh_call) stop_if_not(length(rsh_call) == 1L) diff --git a/README.md b/README.md index 3cbdeb5..50d0d95 100644 --- a/README.md +++ b/README.md @@ -128,3 +128,8 @@ This will install the package from source. Because of this and because this pac + +## Contributing + +To contribute to this package, please see [CONTRIBUTING.md](CONTRIBUTING.md). +