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

`plan("multisession")` stuck when using Nord VPN #654

Closed gacolitti closed 1 year ago

gacolitti commented 1 year ago

When I am connected to VPN plan("multisession") gets stuck and I have to terminate the running process in RStudio.

After I disconnect from VPN it works fine.

It also seems to get stuck when I disconnect from the internet.

Is an internet connection (or a specific type of connection) required for plan("multisession") to work?

HenrikBengtsson commented 1 year ago

Interesting. What's your session info and OS?

gacolitti commented 1 year ago

Here is my session Info:

sessionInfo()
#> R version 4.2.0 (2022-04-22)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> Running under: macOS Monterey 12.6
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] rstudioapi_0.13   knitr_1.39        magrittr_2.0.3    R.cache_0.16.0   
#>  [5] rlang_1.0.6       fastmap_1.1.0     fansi_1.0.3       stringr_1.4.1    
#>  [9] styler_1.7.0      highr_0.9         tools_4.2.0       xfun_0.31        
#> [13] R.oo_1.25.0       utf8_1.2.2        cli_3.4.1         withr_2.5.0      
#> [17] htmltools_0.5.2   yaml_2.3.5        digest_0.6.29     tibble_3.1.8     
#> [21] lifecycle_1.0.2   purrr_0.3.4       R.utils_2.12.0    vctrs_0.4.2      
#> [25] fs_1.5.2          glue_1.6.2        evaluate_0.16     rmarkdown_2.14   
#> [29] reprex_2.0.2      stringi_1.7.8     compiler_4.2.0    pillar_1.8.1     
#> [33] R.methodsS3_1.8.2 pkgconfig_2.0.3

Created on 2022-10-16 with reprex v2.0.2

Let me know if there is anything else I can provide. Thanks!

HenrikBengtsson commented 1 year ago

Sorry, I wasn't clear. I would like to see sessionInfo() after you did library(future).

I have some guesses, but next, for troubleshooting purposes, what is the output when you run the following in a fresh R session when you're connected to the Nord VPN:

options(parallelly.debug = TRUE)
cl <- parallelly::makeClusterPSOCK(1)

?

gacolitti commented 1 year ago

Here is session info after library(future):

library(future)

sessionInfo()
#> R version 4.2.0 (2022-04-22)
#> Platform: aarch64-apple-darwin20 (64-bit)
#> Running under: macOS Monterey 12.6
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] future_1.28.0
#> 
#> loaded via a namespace (and not attached):
#>  [1] pillar_1.8.1      compiler_4.2.0    highr_0.9         R.methodsS3_1.8.2
#>  [5] R.utils_2.12.0    tools_4.2.0       digest_0.6.29     evaluate_0.16    
#>  [9] lifecycle_1.0.2   tibble_3.1.8      R.cache_0.16.0    pkgconfig_2.0.3  
#> [13] rlang_1.0.6       reprex_2.0.2      cli_3.4.1         rstudioapi_0.13  
#> [17] yaml_2.3.5        parallel_4.2.0    xfun_0.31         fastmap_1.1.0    
#> [21] withr_2.5.0       styler_1.7.0      stringr_1.4.1     knitr_1.39       
#> [25] fs_1.5.2          vctrs_0.4.2       globals_0.16.1    glue_1.6.2       
#> [29] listenv_0.8.0     fansi_1.0.3       parallelly_1.32.1 rmarkdown_2.14   
#> [33] purrr_0.3.4       magrittr_2.0.3    codetools_0.2-18  htmltools_0.5.2  
#> [37] utf8_1.2.2        stringi_1.7.8     R.oo_1.25.0

Created on 2022-10-17 with reprex v2.0.2

Now I run the following code on VPN:

options(parallelly.debug = TRUE)
cl <- parallelly::makeClusterPSOCK(1)

and get the following output:

[10:02:58.142] Set package option ‘parallelly.availableCores.methods’
[10:02:58.149] Environment variable ‘R_PARALLELLY_AVAILABLECORES_METHODS’ not set
[10:02:58.149] Set package option ‘parallelly.availableCores.fallback’
[10:02:58.150] Environment variable ‘R_PARALLELLY_AVAILABLECORES_FALLBACK’ not set
[10:02:58.150] Set package option ‘parallelly.availableCores.min’
[10:02:58.150] Environment variable ‘R_PARALLELLY_AVAILABLECORES_MIN’ not set
[10:02:58.150] Set package option ‘parallelly.availableCores.system’
[10:02:58.150] Environment variable ‘R_PARALLELLY_AVAILABLECORES_SYSTEM’ not set
[10:02:58.150] Set package option ‘parallelly.availableCores.logical’
[10:02:58.179] Environment variable ‘R_PARALLELLY_AVAILABLECORES_LOGICAL’ not set
[10:02:58.179] Set package option ‘parallelly.availableCores.omit’
[10:02:58.179] Environment variable ‘R_PARALLELLY_AVAILABLECORES_OMIT’ not set
[10:02:58.179] Set package option ‘parallelly.availableWorkers.methods’
[10:02:58.179] Environment variable ‘R_PARALLELLY_AVAILABLEWORKERS_METHODS’ not set
[10:02:58.179] Set package option ‘parallelly.fork.enable’
[10:02:58.180] Environment variable ‘R_PARALLELLY_FORK_ENABLE’ not set
[10:02:58.180] Set package option ‘parallelly.supportsMulticore.unstable’
[10:02:58.180] Environment variable ‘R_PARALLELLY_SUPPORTSMULTICORE_UNSTABLE’ not set
[10:02:58.180] Set package option ‘parallelly.makeNodePSOCK.setup_strategy’
[10:02:58.180] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_SETUP_STRATEGY’ not set
[10:02:58.180] Set package option ‘parallelly.makeNodePSOCK.validate’
[10:02:58.180] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_VALIDATE’ not set
[10:02:58.180] Set package option ‘parallelly.makeNodePSOCK.connectTimeout’
[10:02:58.180] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_CONNECTTIMEOUT’ not set
[10:02:58.180] Set package option ‘parallelly.makeNodePSOCK.timeout’
[10:02:58.180] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_TIMEOUT’ not set
[10:02:58.181] Set package option ‘parallelly.makeNodePSOCK.useXDR’
[10:02:58.181] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_USEXDR’ not set
[10:02:58.181] Set package option ‘parallelly.makeNodePSOCK.socketOptions’
[10:02:58.181] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_SOCKETOPTIONS’ not set
[10:02:58.181] Set package option ‘parallelly.makeNodePSOCK.rshcmd’
[10:02:58.181] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_RSHCMD’ not set
[10:02:58.181] Set package option ‘parallelly.makeNodePSOCK.rshopts’
[10:02:58.181] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_RSHOPTS’ not set
[10:02:58.181] Set package option ‘parallelly.makeNodePSOCK.tries’
[10:02:58.182] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_TRIES’ not set
[10:02:58.182] Set package option ‘parallelly.makeNodePSOCK.tries.delay’
[10:02:58.182] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_TRIES_DELAY’ not set
[10:02:58.182] Set package option ‘parallelly.makeNodePSOCK.rscript_label’
[10:02:58.182] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_RSCRIPT_LABEL’ not set
[10:02:58.182] Set package option ‘parallelly.makeNodePSOCK.sessionInfo.pkgs’
[10:02:58.182] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_SESSIONINFO_PKGS’ not set
[10:02:58.182] Set package option ‘parallelly.makeNodePSOCK.autoKill’
[10:02:58.182] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_AUTOKILL’ not set
[10:02:58.183] Set package option ‘parallelly.makeNodePSOCK.master.localhost.hostname’
[10:02:58.183] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_MASTER_LOCALHOST_HOSTNAME’ not set
[10:02:58.183] Set package option ‘parallelly.makeNodePSOCK.port.increment’
[10:02:58.183] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_PORT_INCREMENT’ not set
[10:02:58.184] parallelly-specific environment variables:
[10:02:58.247] [local output] Workers: [n = 1] ‘localhost’
[10:02:58.248] [local output] Base port: 11443
[10:02:58.248] [local output] Getting setup options for 1 cluster nodes ...
[10:02:58.248] [local output]  - Node 1 of 1 ...
[10:02:58.248] [local output] localMachine=TRUE => revtunnel=FALSE

[10:02:58.249] Testing if worker's PID can be inferred: ‘'/Library/Frameworks/R.framework/Resources/bin/Rscript' -e 'try(suppressWarnings(cat(Sys.getpid(),file="/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpNxVKLh/worker.rank=1.parallelly.parent=34272.85e03000160a.pid")), silent = TRUE)' -e 'file.exists("/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpNxVKLh/worker.rank=1.parallelly.parent=34272.85e03000160a.pid")'’
[10:02:58.370] - Possible to infer worker's PID: TRUE
[10:02:58.371] [local output] Rscript port: 11443

[10:02:58.371] [local output] Getting setup options for 1 cluster nodes ... done
[10:02:58.371] [local output]  - Parallel setup requested for some PSOCK nodes
[10:02:58.371] [local output] Setting up PSOCK nodes in parallel
[10:02:58.371] List of 20
[10:02:58.371]  $ local_cmd     : chr "'/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,st"| __truncated__
[10:02:58.371]  $ worker        : chr "localhost"
[10:02:58.371]   ..- attr(*, "localhost")= logi TRUE
[10:02:58.371]  $ rank          : int 1
[10:02:58.371]  $ rshlogfile    : NULL
[10:02:58.371]  $ port          : int 11443
[10:02:58.371]  $ connectTimeout: num 120
[10:02:58.371]  $ timeout       : num 2592000
[10:02:58.371]  $ useXDR        : logi FALSE
[10:02:58.371]  $ pidfile       : chr "/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpNxVKLh/worker.rank=1.parallelly.parent=34272.85e03000160a.pid"
[10:02:58.371]  $ setup_strategy: chr "parallel"
[10:02:58.371]  $ outfile       : chr "/dev/null"
[10:02:58.371]  $ rshcmd_label  : NULL
[10:02:58.371]  $ rsh_call      : NULL
[10:02:58.371]  $ cmd           : chr "'/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,st"| __truncated__
[10:02:58.371]  $ localMachine  : logi TRUE
[10:02:58.371]  $ manual        : logi FALSE
[10:02:58.371]  $ dryrun        : logi FALSE
[10:02:58.371]  $ quiet         : logi FALSE
[10:02:58.371]  $ rshcmd        : NULL
[10:02:58.371]  $ revtunnel     : logi FALSE
[10:02:58.371]  - attr(*, "class")= chr [1:2] "makeNodePSOCKOptions" "makeNodeOptions"
[10:02:58.375] [local output] System call to launch all workers:
[10:02:58.375] [local output] '/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e 'try(suppressWarnings(cat(Sys.getpid(),file="/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpNxVKLh/worker.rank=1.parallelly.parent=34272.85e03000160a.pid")), silent = TRUE)' -e 'options(socketOptions = "no-delay")' -e 'workRSOCK <- tryCatch(parallel:::.workRSOCK, error=function(e) parallel:::.slaveRSOCK); workRSOCK()' MASTER=localhost PORT=11443 OUT=/dev/null TIMEOUT=2592000 XDR=FALSE SETUPTIMEOUT=120 SETUPSTRATEGY=parallel
[10:02:58.375] [local output] Starting PSOCK main server
[10:02:58.378] [local output] Workers launched
[10:02:58.378] [local output] Waiting for workers to connect back
[10:02:58.378] [local output] 0 workers out of 1 ready

parallelly::makeClusterPSOCK(1) never finishes. I have to kill it.

HenrikBengtsson commented 1 year ago

Thanks. This confirms (i) it has nothing to do with future per se, (ii) most likely also not parallelly, parallel, or even R itself, but instead it's (iii) the Nord VPN client that redirects localhost(*) to their servers.

(*) See that MASTER=localhost and PORT=11443 and the end of your output - it tells the parallel worker to connect back to the main R session on port 11443 on a host named localhost. So, I think your Nord VPN intercepts that localhost and redirects it to their VPN servers, and, obviously, there is no main R session there to answer that connection request.

Let's see if it intercepts also 127.0.0.1, which is what localhost resolves to on most computers. Try the following:

options(parallelly.debug = TRUE)
options(parallelly.localhost.hostname = "127.0.0.1")
cl <- parallelly::makeClusterPSOCK(1)

Does this work?

gacolitti commented 1 year ago

I still have to terminate the process.

Here is the output:

[20:15:11.610] Set package option ‘parallelly.availableCores.methods’
[20:15:11.617] Environment variable ‘R_PARALLELLY_AVAILABLECORES_METHODS’ not set
[20:15:11.618] Set package option ‘parallelly.availableCores.fallback’
[20:15:11.618] Environment variable ‘R_PARALLELLY_AVAILABLECORES_FALLBACK’ not set
[20:15:11.618] Set package option ‘parallelly.availableCores.min’
[20:15:11.618] Environment variable ‘R_PARALLELLY_AVAILABLECORES_MIN’ not set
[20:15:11.618] Set package option ‘parallelly.availableCores.system’
[20:15:11.618] Environment variable ‘R_PARALLELLY_AVAILABLECORES_SYSTEM’ not set
[20:15:11.618] Set package option ‘parallelly.availableCores.logical’
[20:15:11.618] Environment variable ‘R_PARALLELLY_AVAILABLECORES_LOGICAL’ not set
[20:15:11.618] Set package option ‘parallelly.availableCores.omit’
[20:15:11.618] Environment variable ‘R_PARALLELLY_AVAILABLECORES_OMIT’ not set
[20:15:11.619] Set package option ‘parallelly.availableWorkers.methods’
[20:15:11.619] Environment variable ‘R_PARALLELLY_AVAILABLEWORKERS_METHODS’ not set
[20:15:11.619] Set package option ‘parallelly.fork.enable’
[20:15:11.619] Environment variable ‘R_PARALLELLY_FORK_ENABLE’ not set
[20:15:11.619] Set package option ‘parallelly.supportsMulticore.unstable’
[20:15:11.619] Environment variable ‘R_PARALLELLY_SUPPORTSMULTICORE_UNSTABLE’ not set
[20:15:11.619] Set package option ‘parallelly.makeNodePSOCK.setup_strategy’
[20:15:11.619] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_SETUP_STRATEGY’ not set
[20:15:11.619] Set package option ‘parallelly.makeNodePSOCK.validate’
[20:15:11.619] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_VALIDATE’ not set
[20:15:11.620] Set package option ‘parallelly.makeNodePSOCK.connectTimeout’
[20:15:11.620] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_CONNECTTIMEOUT’ not set
[20:15:11.620] Set package option ‘parallelly.makeNodePSOCK.timeout’
[20:15:11.620] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_TIMEOUT’ not set
[20:15:11.620] Set package option ‘parallelly.makeNodePSOCK.useXDR’
[20:15:11.620] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_USEXDR’ not set
[20:15:11.620] Set package option ‘parallelly.makeNodePSOCK.socketOptions’
[20:15:11.620] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_SOCKETOPTIONS’ not set
[20:15:11.620] Set package option ‘parallelly.makeNodePSOCK.rshcmd’
[20:15:11.621] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_RSHCMD’ not set
[20:15:11.621] Set package option ‘parallelly.makeNodePSOCK.rshopts’
[20:15:11.621] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_RSHOPTS’ not set
[20:15:11.621] Set package option ‘parallelly.makeNodePSOCK.tries’
[20:15:11.621] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_TRIES’ not set
[20:15:11.621] Set package option ‘parallelly.makeNodePSOCK.tries.delay’
[20:15:11.621] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_TRIES_DELAY’ not set
[20:15:11.621] Set package option ‘parallelly.makeNodePSOCK.rscript_label’
[20:15:11.621] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_RSCRIPT_LABEL’ not set
[20:15:11.621] Set package option ‘parallelly.makeNodePSOCK.sessionInfo.pkgs’
[20:15:11.621] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_SESSIONINFO_PKGS’ not set
[20:15:11.622] Set package option ‘parallelly.makeNodePSOCK.autoKill’
[20:15:11.622] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_AUTOKILL’ not set
[20:15:11.622] Set package option ‘parallelly.makeNodePSOCK.master.localhost.hostname’
[20:15:11.622] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_MASTER_LOCALHOST_HOSTNAME’ not set
[20:15:11.622] Set package option ‘parallelly.makeNodePSOCK.port.increment’
[20:15:11.622] Environment variable ‘R_PARALLELLY_MAKENODEPSOCK_PORT_INCREMENT’ not set
[20:15:11.623] parallelly-specific environment variables:
[20:15:11.656] [local output] Workers: [n = 1] ‘127.0.0.1’
[20:15:11.657] [local output] Base port: 11912
[20:15:11.657] [local output] Getting setup options for 1 cluster nodes ...
[20:15:11.657] [local output]  - Node 1 of 1 ...
[20:15:11.657] [local output] localMachine=TRUE => revtunnel=FALSE

[20:15:11.658] Testing if worker's PID can be inferred: ‘'/Library/Frameworks/R.framework/Resources/bin/Rscript' -e 'try(suppressWarnings(cat(Sys.getpid(),file="/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpZuQozD/worker.rank=1.parallelly.parent=50050.c38250ac52f9.pid")), silent = TRUE)' -e 'file.exists("/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpZuQozD/worker.rank=1.parallelly.parent=50050.c38250ac52f9.pid")'’
[20:15:11.780] - Possible to infer worker's PID: TRUE
[20:15:11.781] [local output] Rscript port: 11912

[20:15:11.781] [local output] Getting setup options for 1 cluster nodes ... done
[20:15:11.781] [local output]  - Parallel setup requested for some PSOCK nodes
[20:15:11.781] [local output] Setting up PSOCK nodes in parallel
[20:15:11.781] List of 20
[20:15:11.781]  $ local_cmd     : chr "'/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,st"| __truncated__
[20:15:11.781]  $ worker        : chr "127.0.0.1"
[20:15:11.781]   ..- attr(*, "localhost")= logi TRUE
[20:15:11.781]  $ rank          : int 1
[20:15:11.781]  $ rshlogfile    : NULL
[20:15:11.781]  $ port          : int 11912
[20:15:11.781]  $ connectTimeout: num 120
[20:15:11.781]  $ timeout       : num 2592000
[20:15:11.781]  $ useXDR        : logi FALSE
[20:15:11.781]  $ pidfile       : chr "/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpZuQozD/worker.rank=1.parallelly.parent=50050.c38250ac52f9.pid"
[20:15:11.781]  $ setup_strategy: chr "parallel"
[20:15:11.781]  $ outfile       : chr "/dev/null"
[20:15:11.781]  $ rshcmd_label  : NULL
[20:15:11.781]  $ rsh_call      : NULL
[20:15:11.781]  $ cmd           : chr "'/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,st"| __truncated__
[20:15:11.781]  $ localMachine  : logi TRUE
[20:15:11.781]  $ manual        : logi FALSE
[20:15:11.781]  $ dryrun        : logi FALSE
[20:15:11.781]  $ quiet         : logi FALSE
[20:15:11.781]  $ rshcmd        : NULL
[20:15:11.781]  $ revtunnel     : logi FALSE
[20:15:11.781]  - attr(*, "class")= chr [1:2] "makeNodePSOCKOptions" "makeNodeOptions"
[20:15:11.785] [local output] System call to launch all workers:
[20:15:11.785] [local output] '/Library/Frameworks/R.framework/Resources/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e 'try(suppressWarnings(cat(Sys.getpid(),file="/var/folders/0w/5zgdb04x3_75lzcktwfcbdtm0000gn/T//RtmpZuQozD/worker.rank=1.parallelly.parent=50050.c38250ac52f9.pid")), silent = TRUE)' -e 'options(socketOptions = "no-delay")' -e 'workRSOCK <- tryCatch(parallel:::.workRSOCK, error=function(e) parallel:::.slaveRSOCK); workRSOCK()' MASTER=127.0.0.1 PORT=11912 OUT=/dev/null TIMEOUT=2592000 XDR=FALSE SETUPTIMEOUT=120 SETUPSTRATEGY=parallel
[20:15:11.786] [local output] Starting PSOCK main server
[20:15:11.789] [local output] Workers launched
[20:15:11.789] [local output] Waiting for workers to connect back
[20:15:11.789] [local output] 0 workers out of 1 ready
HenrikBengtsson commented 1 year ago

Got it. Okay, so this cannot be solved by R, or from within R ... or any other software on your machine. I'm pretty sure this is the NordVPN client reconfiguring your computer's network to redirect everything to go via their servers (e.g. [0]). As a last test, if you run the following from the terminal;

ssh localhost 'date'

and

ssh localhost 'date'

both will freeze when you're connected to the NordVPN, while they otherwise gives something like:

$ ssh localhost 'date'
Mon 17 Oct 2022 08:17:14 PM PDT

$ ssh 127.0.0.1 'date'
Mon 17 Oct 2022 08:17:39 PM PDT

Is that how it works for you?

[0] https://www.reddit.com/r/nordvpn/comments/kqrq1a/nordvpn_split_tunnelling_and_localhost/

gacolitti commented 1 year ago

Yes that is the behavior I see.

I discovered that this issue seems to be related to the advanced kill switch feature in the Nord VPN app. Turning this feature off resolves the issue for me.

Thanks for your help @HenrikBengtsson.

HenrikBengtsson commented 1 year ago

Great. I've now documented this problem with strict VPNs in Section 'Failing to set up local workers' of help("makeClusterPSOCK", package = "parallelly").