Repository navigation
Close EE on every Quit and keep reconnecting after a switch restart - #46
Merged
Merged
Conversation
Quit kept EE open when it could not confirm that the switch lighting was returned, for example while the switch restarted, and a second Quit waited for four more gateway attempts. Every Quit now hides the window at once and makes one close attempt. When that is not confirmed, the desktop sends "exit" to the gateway, which closes private and LAN access, tells the engine to quit and exits within 10 seconds; the unconfirmed exit is recorded so the next start recovers the lighting. The engine stopped reconnecting after five failures, about a minute, and a connection lost during a write waited for Reconnect switch. Connection errors now retry for as long as the engine runs, with the delay capped at a minute. Output that a lost connection left unconfirmed is recovered with the same steps as Reconnect switch once the switch answers, and lighting resumes only if it was running. For 10 minutes after a lost connection, a switch that answers before its lighting is ready is retried too. A rejected login, a changed SSH key or a changed ownership record still stops the attempts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After a switch restart, EE logged "lost the switch" and did not reconnect for the 36 minutes before it was restarted, and Quit from the tray left EE running.
Quit
When Quit could not confirm that the switch lighting was returned, EE stayed open and asked for a second Quit, which then waited for four more gateway cleanup attempts before ending the service.
ServiceHostwritesexitto the gateway and waits up to 15 seconds before ending the process tree. The unconfirmed exit is recorded inlast-session.json, so the next start recovers the lighting.exitthe gateway makes no further release attempt: it tells the engine to quit, closes private and LAN access, and exits within 10 seconds. Closing its input withoutexitstill starts the four-attempt cleanup used after a desktop crash.Reconnect
LightingCapabilityErrorduring recovery) is retried as a switch that is still starting.reconnect_required.Verification
ruff checkclean.--quit-check(confirmed, refused then exited, refused and unresponsive) and--serviceagainst the simulator, 1,987 checks passed.exit, and both engine processes ended.stop()not waiting for an automatic attempt.