Closed hadley closed 3 years ago
Oooh the problem only occurs in R CMD check
, possibly because R CMD check limits the number of processes that you're allowed to create?
Yeah, this is parallel:::.check_ncores()
:
function (nc)
{
chk <- tolower(Sys.getenv("_R_CHECK_LIMIT_CORES_", ""))
if (nzchar(chk) && (chk != "false") && nc > 2L) {
msg <- sprintf("%d simultaneous processes spawned", nc)
if (chk == "warn")
warning(msg, call. = FALSE, immediate. = TRUE)
else stop(msg, call. = TRUE)
}
}
So maybe init_pool()
could do min(size, as.numeric(Sys.getenv("_R_CHECK_LIMIT_CORES_", Inf))
or similar.
Right, this is why I skip testing the pool on CRAN: https://github.com/Azure/AzureRMR/blob/master/tests/testthat/test00_pool.R 😉
storage_multidownload/upload
allows setting the maximum number of transfers, so you could insert a check there. I see that you've put the check in azure_cores
; a more flexible solution might be to allow specifying the no. of transfers in pin_store
. That way you can move the check entirely into the testing code.
Yeah, that's a good idea.
(e.g. https://github.com/rstudio/pins/pull/483/checks?check_run_id=3364204767)
It seems to be happening reliably on GHA, but I don't see the problem locally. Any ideas?