Skip to content
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

windows: Panic if 2 Windows users try to have the same app running at the same time #34

Open
ReactorScram opened this issue Dec 6, 2023 · 0 comments
Labels
bug Something isn't working platform: windows

Comments

@ReactorScram
Copy link

ReactorScram commented Dec 6, 2023

Saw this over on the Firezone client: firezone/firezone#2808

The 2nd app instance panics here:

.expect("Can't create listener");

I'm guessing what happens is, when prepare tries to connect to the listening socket owned by the other Windows user, it fails, so it believes the 2nd instance is actually the 1st instance.

But then when register tries to open the socket and listen for itself, it fails because they're in the same namespace.

I thought of a few possible patches, but it's not critical for our project so I haven't started on any:

  1. Move the bind out of the worker thread and change the expect into returning an error before the worker thread is started. This means you can't run the app in 2 Windows sessions at once, but at least it won't panic in the worker thread
  2. Add the user's ID into the socket's ID so that you can have 2 separate sockets, but only one per user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: windows
Projects
None yet
Development

No branches or pull requests

2 participants