-
Notifications
You must be signed in to change notification settings - Fork 48
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
Socket discovery doesn't work across multiple PowerShell versions #44
Comments
Can you clarify what you mean by opening the socket on a version of PowerShell: calling into Interprocess from the PowerShell runtime via FFI (P/Invoke..?) or launching a Rust program via PowerShell that makes use of Interprocess? I can (have both WinPS5 and PS7 installed, and am fairly familiar with both of them) and will look into thismyself after I roll out all of the general fixes that are currently in motion, but one possible cause that comes to mind is that if you installed PowerShell 7 through Windows Store, it might be doing isolation of some sort. Here's the best lead on why this could be that I could think of off the top of my head:
I assume that you're not on 1709, and am very sure that Windows Store PS7 isn't UWP, but I figured that something similar to this kind of isolation might be going on. |
The latter: launching a Rust program via PowerShell using interprocess. My local reproduction is launching one instance from the terminal built into Rider (IntelliJ), with $PSVersionTable of 5.1 and the other in VSCode with a PSVersion of 7.2.8. One of them is PS Desktop and the other is PS Core which may be what's causing that isolation though I'm not really sure. Interestingly, the error my program ends up spitting out is a "port is already in use" error - I'm using the socket connection to determine if one instance is a "leader" and should spin up the server and if one is a "follower" and should send messages that update the existing server. If you want to try it out with the actual program I'm using you can clone https://github.com/apollographql/rover. |
Is this still an issue on 2.1.0? |
Hey @kotauskas - I no longer work for Apollo so I'm not spending too much time with this project anymore. Thanks for all your help in the past though, hope you're well :) |
Describe the bug
Once a socket has been opened on one version of PowerShell, other versions of PowerShell cannot send/read messages to/from the opened socket.
To Reproduce
Using
LocalSocketStream::connect("@known-name.sock")
:connect
in one process in PowerShell 5, it should succeed and doesconnect
in another process in PowerShell 7, it should fail, but succeedsExpected behavior
Instead of the second connection succeeding, it should fail because there is already a process attached to that socket.
The text was updated successfully, but these errors were encountered: