Repository navigation
Stop the snapmaker_connection CLI when Orca quits on macOS (#1238) - #1240
Open
alandebortolo wants to merge 1 commit into
Open
alandebortolo wants to merge 1 commit into
alandebortolo wants to merge 1 commit into
Conversation
3 tasks done
Author
|
Compiled and ran the gateway tests for this branch locally on macOS (arm64, Apple clang), building the
Still not done here: a full app build and a LAN send to a real U1 after restarting Orca. |
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.
Fixes #1238 on the Orca side: on macOS, quitting Orca now stops the
snapmaker_connectionCLI it started, so the next Orca launches a fresh one instead of reusing an orphan.Why.
GUI_App::shutdown()callsstop_gateway_service(), which stopsGatewayService(worker, websocket) but leaves the detached CLI running. After the quit it is reparented to launchd (ppid 1). The next Orca's/api/healthcheck returns 200, so no stale-owner takeover happens and the orphan is reused. In the log attached to #1238, that orphan fails every LAN connect in 1-2 ms with EHOSTUNREACH whilencto the same IP and port works from the same Mac, and a freshly started CLI connects first time. That matches macOS Local Network privacy being tied to the responsible (launching) app; the reporter also lists a Wi-Fi change as a possible confound, so I have not proved the cause, only that a fresh CLI works where the orphan does not.Change (+45 -5, 5 files; 31 of the added lines are the test).
GatewayService::stop(bool terminate_cli = false): after the worker joins, callsprocess_manager->terminate()when asked. Default keeps today's behaviour for every other caller.GUI_App::stop_gateway_service(bool terminate_cli = false)passes it through.GUI_App::shutdown()passes!isRecreateon macOS only. GUI recreation (start_gateway_service(true)aftermainframe->shutdown(true)) and Windows/Linux are unchanged.GatewayService stop terminates the CLI only when asked(tests/slic3rutils), using the existingRecordingProcessManager: 0 terminate calls withfalse, exactly 1 withtrue, and a secondstop()stays a no-op.Limits, honestly.
GatewayService.cpp,ConnectionProcessManager.cpp,Http.cppandGatewayService_test.cppagainst Boost 1.84) were compiled and run locally on macOS: 17 test cases pass, and the new test fails with the fix removed (details in the first comment). I have not built the full app.terminate()kills only the CLI this Orca spawned (the tracker). A user who already has an orphan from an earlier session still needs one manual kill or reboot after updating; from then on each quit cleans up. Teaching the health check to spot a stale owner (your third option in [2.4.1][macOS] After restarting Orca, the reused snapmaker_control helper fails every LAN connect instantly with "No route to host" (errno 65) until it is killed #1238) would cover that, but it needs a signal from the CLI that it cannot reach the LAN, which I cannot see from Orca's side.