Repository navigation
Fix #267, enforce the routing socket-error limit - #268
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
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.
Describe the contribution
Fixes #267.
Remove the unconditional inner receive loop from
RoutingService.run, so the existing cumulative five-error condition is evaluated after every receive attempt. Previously persistent socket errors incremented the counter insidewhile Trueindefinitely and never reached the outer limit.The existing one-second delay after each error, short-packet filtering, host discovery, packet topics, forwarding payloads, and exception propagation are preserved. This is a retry-exhaustion fix, not a redesign of
stop()or blocked-receive shutdown behavior.Testing performed
Added seven standard-library unittest methods that use the real RoutingService/QThread object and Qt signal with isolated UDP/publisher boundaries. One test receives an actual datagram through an ephemeral loopback UDP port and then uses real socket timeouts. Tests call
runsynchronously and replace the error delay, so they do not depend on wall-clock retry sleeps or a GUI event loop.devin a separate worktree: 5 failed, 2 passed. Extra reads terminate with assertions rather than letting the old loop hang the test runner.QT_QPA_PLATFORM=offscreen python -m unittest discover -s tests -v: 7 passed.QT_QPA_PLATFORM=offscreen python -m pytest tests -q --cov=RoutingService --cov-report=term-missing: 7 passed, covering 55/55 RoutingService statements.E4,E7,E9,Fand formatting checks on the new test file, Python compilation, andgit diff --check: passed.Expected behavior changes
The routing loop returns after its fifth cumulative socket error instead of retrying indefinitely. Successful packets do not reset that existing counter. Socket bind failures and non-socket exceptions continue to propagate. No public API, port assignment, telemetry format, dependency, or workflow changes.
Systems tested on
macOS with Python 3.12.11, PyQt5 5.15.11 and pyzmq 27.2.0, based on
devat9fb1174cc118bf0a31453401adf052e448617e84. No flight hardware, complete cFS runtime, threaded GUI lifecycle, external telemetry source, or live ZeroMQ subscriber was tested. Upstream static-analysis/build workflows have not been run locally; their results remain subject to maintainer CI.Third party code
No third-party source added.
Contributor information
Sylvester Kaczmarek (
sylvesterkaczmarek), Personal.Contributor licence agreement completion has not been verified; this PR does not assert that the CLA requirement has been met.