shikokuchuo / mirai

mirai - Minimalist Async Evaluation Framework for R
https://shikokuchuo.net/mirai/
GNU General Public License v3.0
193 stars 10 forks source link

saisei() returns sockets with literal port 0 #51

Closed wlandau closed 1 year ago

wlandau commented 1 year ago

As we previously discussed, a port of 0 in the url argument of daemons() should tell NNG to choose the port. But saisei() returns sockets with a literal port of 0 in the output websocket path. I think this may explain why I still see instances of #50 in crew.

library(mirai)
packageVersion("mirai")
#> [1] ‘0.8.2.9009’
daemons(
  n = 1L,
  url = "ws://127.0.0.1:0",
  dispatcher = TRUE,
  token = TRUE
)
#> [1] 1
daemons()$daemons
#> online instance assigned complete
#> ws://127.0.0.1:51358/7abbf05f04cb077a5e2f89fc0c1de673d1c0bae5      0        0        0        0
saisei(i = 1L)
#> [1] "ws://127.0.0.1:0/ca4f8b8c59f78ed827fd0771c099881439a5f373"
shikokuchuo commented 1 year ago

Thanks for the report! This was quite subtle (in that I thought I had this covered) and the logic gets a bit messy in that part...

But fixed in 0.8.2.9010 together with some other optimisations I was putting through.

wlandau commented 1 year ago

Awesome, thanks! Looks fixed.

Unfortunately I don't think it solves my issues in https://github.com/wlandau/crew/issues/61 just yet, but it is an important step.