Repository navigation
system: raise in connect() when mavsdk_server exits - #843
Merged
julianoes merged 1 commit intoNov 30, 2026
Merged
Conversation
connect() waited for the gRPC channel to become ready without a timeout. When the embedded mavsdk_server exited before that, e.g. because of an invalid connection URL or a UDP port that is already in use, connect() hung forever. While waiting, check whether the server process is still running. If it has exited, stop waiting and raise MavsdkServerExitedError with its exit code. The reason is in the mavsdk_server log messages, which are already logged as errors. Fixes mavlink#585
julianoes
approved these changes
Nov 30, 2026
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.
connect()waits for the gRPC channel with no timeout. If the embedded mavsdk_server exits first (invalid connection URL, port already in use), it hung forever.While waiting,
connect()now checks whether the server process is still running. If it has exited, it stops waiting, cleans up and raisesMavsdkServerExitedErrorwith the exit code. The reason is already logged as an error from themavsdk_serverlogger (since #781).This needs mavlink/MAVSDK#3240: mavsdk_server 4.3.0 doesn't exit on these errors, it keeps waiting without opening its gRPC port. Once that's in a release and
MAVSDK_SERVER_VERSIONis bumped, the hang is gone.Testing
tests/test_system.py(server exits → raises; server running → waits as before). They fail without the change; all 5 pass.udp://14540and a busyudpin://0.0.0.0:14600both raise after 0.2 s. With the 4.3.0 server it still hangs, as expected.Fixes #585
Fixes #759 (
udpin://:14540has no bind address, so it's an invalid URL)@julianoes