Skip to content

Commit

Permalink
widen default timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Jan 17, 2024
1 parent b84f01f commit e1a4170
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# mirai 0.12.0.9000 (development)

* Fixes `daemons()` specifying 'output = FALSE' being taken as TRUE.
* Dispatcher sync (and status) timeouts widened to 10s to allow for launching large numbers of daemons.
* Default for `ssh_config()` argument 'timeout' widened to 10 (seconds).
* Fixes `daemons()` specifying 'output = FALSE' registering as TRUE instead.
* Fixes use of `everywhere()` specifying '.args' as an unnamed list or '.expr' as a language object.

# mirai 0.12.0
Expand Down
2 changes: 1 addition & 1 deletion R/dispatcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ sub_real_port <- function(port, url) sub("(?<=:)0(?![^/])", port, url, perl = TR

query_dispatcher <- function(sock, command, mode) {
send(sock, data = command, mode = 2L, block = .timelimit)
recv(sock, mode = mode, block = .timelimit + .timelimit)
recv(sock, mode = mode, block = .timelimit)
}

create_req <- function(ctx, cv)
Expand Down
7 changes: 4 additions & 3 deletions R/launchers.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ remote_config <- function(command = NULL, args = c("", "."), rscript = "Rscript"
#' @param remotes the character URL or vector of URLs to SSH into, using the
#' 'ssh://' scheme and including the port open for SSH connections (defaults
#' to 22 if not specified), e.g. 'ssh://10.75.32.90:22' or 'ssh://nodename'.
#' @param timeout [default 5] maximum time allowed for connection setup in seconds.
#' @param timeout [default 10] maximum time allowed for connection setup in
#' seconds.
#' @param tunnel [default FALSE] logical value whether to use SSH reverse
#' tunnelling. If TRUE, a tunnel is created between the same ports (as
#' specified in 'url') on the local and remote machines. Setting to TRUE
Expand Down Expand Up @@ -251,7 +252,7 @@ remote_config <- function(command = NULL, args = c("", "."), rscript = "Rscript"
#' respective machines.
#'
#' @examples
#' ssh_config(remotes = c("ssh://10.75.32.90:222", "ssh://nodename"), timeout = 10)
#' ssh_config(remotes = c("ssh://10.75.32.90:222", "ssh://nodename"), timeout = 5)
#'
#' \dontrun{
#'
Expand Down Expand Up @@ -282,7 +283,7 @@ remote_config <- function(command = NULL, args = c("", "."), rscript = "Rscript"
#' @rdname remote_config
#' @export
#'
ssh_config <- function(remotes, timeout = 5, tunnel = FALSE, command = "ssh", rscript = "Rscript") {
ssh_config <- function(remotes, timeout = 10, tunnel = FALSE, command = "ssh", rscript = "Rscript") {

premotes <- lapply(remotes, parse_url)
hostnames <- lapply(premotes, .subset2, "hostname")
Expand Down
4 changes: 2 additions & 2 deletions R/mirai-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ registerPromisesMethods <- function(pkgname, pkgpath) {
requires_local = "SSH tunnelling requires 'url' hostname to be '127.0.0.1' or 'localhost'",
refhook_invalid = "'refhook' must be a list of 2 functions or NULL",
single_url = "only one 'url' should be specified",
sync_timeout = "initial sync with dispatcher timed out after 5s",
sync_timeout = "initial sync with dispatcher timed out after 10s",
url_spec = "numeric value for 'url' is out of bounds",
wrong_dots = "'...' arguments should only be of integer, numeric or logical type"
),
hash = TRUE
)

.intmax <- .Machine[["integer.max"]]
.timelimit <- 5000L
.timelimit <- 10000L

as.promise <- NULL
recvData <- NULL
Expand Down
2 changes: 1 addition & 1 deletion R/mirai.R
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ print.miraiInterrupt <- function(x, ...) {

ephemeral_daemon <- function(url = local_url()) {
sock <- req_socket(url, resend = 0L)
system2(command = .command, args = c("-e", shQuote(sprintf("mirai::.daemon('%s')", url))), stdout = NULL, stderr = NULL, wait = FALSE)
system2(command = .command, args = c("-e", shQuote(sprintf("mirai::.daemon('%s')", url))), stdout = FALSE, stderr = FALSE, wait = FALSE)
sock
}

Expand Down
7 changes: 4 additions & 3 deletions man/remote_config.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1a4170

Please sign in to comment.