-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No need to use mirai::saisei() #136
Comments
Using {nanonext} 0.10.4.9000 and {mirai} 0.11.1.9000, I am finding I can part with |
On the bright side, eliminating |
It is straightforward to reproduce this locally (R 4.3.2, Mac OS 14.1). In a host process, I call: # terminal 1 R session (host)
mirai::daemons(n = 1L, url = "ws://127.0.0.1:5700")
#> [1] 1
mirai::status()
#> $connections
#> [1] 1
#>
#> $daemons
#> i online instance assigned complete
#> ws://127.0.0.1:5700 1 0 0 0 0 Then I start a daemon process in a different terminal.
The host process sees this new daemon. So far so good. # terminal 1 R session (host)
mirai::status()
#> $connections
#> [1] 1
#>
#> $daemons
#> i online instance assigned complete
#> ws://127.0.0.1:5700 1 1 1 0 0 But now when I start a second daemon process in a different terminal, that daemon also connects.
# terminal 1 R session (host)
mirai::status()
#> $connections
#> [1] 1
#>
#> $daemons
#> i online instance assigned complete
#> ws://127.0.0.1:5700 1 0 1 0 0 At this point, both daemons are running (terminals 2 and 3), and the FYI @shikokuchuo |
I am rediscovering that I need to manually reset the instance counter each time I launch a {crew} worker. Otherwise, it's hard to reason about how many worker instances I am expecting and whether the "current" one completed. So I think |
Reopened to close as "not planned". |
Your reprex works as expected for me on Ubuntu 22.04.3, R 4.3.2. The second terminal instance exits straight away. The first one remains connected. With nanonext 0.10.4, mirai 0.11.1. But you report it working with the dev versions anyway so I'm not really concerned. |
I am not sure what is meant here, but it seems possible to create (duplicate to) another counter for this purpose, you don't actually need to manipulate the actual condition value inside the cv right? In my opinion, eliminating saisei() is not a small matter for your semi-transient workers, having to re-create the listeners is just pure overhead - I wouldn't be so quick to dismiss. |
Say I launch a worker as an AWS Batch spot instance. It could take a few seconds or several minutes to connect to the host, depending pricing fluctuations on the cloud.
Here, we would expect an We had a similar discussion about this in #31 leading up to the implementation of |
Thanks, that's very clear now. Locked sockets will ensure that only one daemon can connect at any one time, but it doesn't guarantee that the correct one does in your example above. |
The most recent version of
mirai
locks dispatcher sockets, so only one worker can connect at a time. That meanscrew
should no longer need to rotate websocket URLs (I plan to test this locally).The text was updated successfully, but these errors were encountered: