-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: Handle standby connection issue #92
Conversation
Further: Some time after a long standby the websocket will receive a close event. It is not possible to distinguish between this and other close events. Will maybe handle it heuristically with timestamps. |
Any reason not just to try to reconnect? |
Maybe I’m missing something, but I think e9dcb55 solves the issue. Before these changes the socket connection would disconnect (and not reconnect as intended) shortly after the system had been either on standby or in hibernate mode. After these changes my system seems to reconnected/restart the flix session as soon as it disconnects. This only leaves a short interval where the connection is down (when reconnecting). I don’t know if we had a reason to not merge this or if it was simply never tested? To recreate this bug (on my system):
|
I just think it was never tested. Or maybe it did not work 100%. No idea if @plougsgaard remembers? |
If you seem satisfied with the fix (both code and testing) then we can merge it in. |
Maybe you can test, on Linux, by enabling a firewall rule that REJECTs the packages going to VSCode/Flix? And then dropping the firewall rule. |
The code looks to me like it should work and I have been testing it for a while now, trying to get the same error and haven’t been able to. I think we should try to merge.
Maybe I don’t completely understand this. I’m not on a Linux system. If you mean that this is a way to reproduce the bug, I think you could be right. I tried producing the bug in a similar way using windows defender, but I’m not always good friends with that program, so there might also be a way to get it to work on windows (I wasn't able to when i tried) |
@mR4smussen Does this PR restart the extension, the Flix compiler, or both? I would say it should not be necessary to restart the Flix compiler (which can be slow). But I am also not sure if that is what is happening. |
From what I can see and understand this only restarts the extension. For instance, I can run a flix program as soon as the extension has restarted, without the compiler needing to start up again. |
Does it display a notification that it has reconnected? |
Ok |
@mR4smussen It seems that this PR has broken the action "Restart Flix Compiler". Can you confirm? |
That is correct :(. I'm not sure why yet, But I could imagine that since we now start a new compiler when a compiler is closed, a restart could result in two compilers being started at once. In my experience it does work after starting a couple of times, but this is obviously not optimal. I will look for a fix to this tomorrow or in the weekend |
Sounds good. |
Fixes #91
(pending more testing)