HenrikBengtsson / future

:rocket: R package: future: Unified Parallel and Distributed Processing in R for Everyone
https://future.futureverse.org
946 stars 82 forks source link

future::plan(multisession) is failing #520

Closed jmoggridge closed 3 years ago

jmoggridge commented 3 years ago

plan(multisession, workers = 2) fails.

It returns this error: Error in makeClusterPSOCK(workers, ...) : Cluster setup failed. 2 of 2 workers failed to connect.

I think installing some other packages may have created the issue because plan() was working fine earlier today. I tried restarting R but doesn't solve the issue, however. Any troubleshooting advice would be really appreciated, I have a bunch of code that is using furrr.

When I run availableCores() it says 8.

reprex

library(future)
plan(multisession, workers = 2)

Session information

sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> Running under: macOS Big Sur 11.2.3
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#>  [1] forcats_0.5.1   stringr_1.4.0   dplyr_1.0.7     purrr_0.3.4    
#>  [5] readr_1.4.0     tidyr_1.1.3     tibble_3.1.2    ggplot2_3.3.5  
#>  [9] tidyverse_1.3.1 furrr_0.2.3     future_1.21.0  
#> 
#> loaded via a namespace (and not attached):
#>  [1] styler_1.4.1      tidyselect_1.1.1  xfun_0.24         listenv_0.8.0    
#>  [5] haven_2.4.1       colorspace_2.0-2  vctrs_0.3.8       generics_0.1.0   
#>  [9] htmltools_0.5.1.1 yaml_2.2.1        utf8_1.2.1        rlang_0.4.11     
#> [13] pillar_1.6.1      glue_1.4.2        withr_2.4.2       DBI_1.1.1        
#> [17] dbplyr_2.1.1      readxl_1.3.1      modelr_0.1.8      lifecycle_1.0.0  
#> [21] cellranger_1.1.0  munsell_0.5.0     gtable_0.3.0      rvest_1.0.0      
#> [25] codetools_0.2-18  evaluate_0.14     knitr_1.33        parallel_4.1.0   
#> [29] fansi_0.5.0       highr_0.9         broom_0.7.8       Rcpp_1.0.6       
#> [33] backports_1.2.1   scales_1.1.1      jsonlite_1.7.2    parallelly_1.26.0
#> [37] fs_1.5.0          hms_1.1.0         digest_0.6.27     stringi_1.6.2    
#> [41] grid_4.1.0        cli_2.5.0         tools_4.1.0       magrittr_2.0.1   
#> [45] crayon_1.4.1      pkgconfig_2.0.3   ellipsis_0.3.2    xml2_1.3.2       
#> [49] reprex_2.0.0      lubridate_1.7.10  rstudioapi_0.13   assertthat_0.2.1 
#> [53] rmarkdown_2.9     httr_1.4.2        R6_2.5.0          globals_0.14.0   
#> [57] compiler_4.1.0
HenrikBengtsson commented 3 years ago

Hi. This is a duplicate of #511. It's due to a bug in R that affects RStudio but not R in the terminal. More importantly, upgrading to the just released parallelly 1.26.1 works around this bug.

jmoggridge commented 3 years ago

Thanks so much! Sorry I missed that