Repository navigation
transport: Fix hangs and lost scripts on stop/exec - #29
Merged
Merged
Conversation
A camera that keeps sending events (e.g. stdout) while never answering a command would keep resetting the timeout and hang the host forever. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Packets with a valid header but an unexpected sequence were dropped silently, so the host waited until the timeout for a response that would never come (e.g. the camera NAKs with sequence 0 after a soft reboot). Raise a SequenceException instead so the host resyncs. The header CRC is now checked before the sequence, so a corrupted header is skipped rather than raised on. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
STOP only schedules an interrupt, the script may take a while to exit (e.g. it handles KeyboardInterrupt). A script written before then is ACKed by the old context and discarded when the script exits. Poll the stdin channel until the script stops or a timeout expires, and stop a running script before exec. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
iabdalkader
force-pushed
the
transport_resync_fixes
branch
from
November 7, 2026 15:42
1353e7c to
2c9e1d4
Compare
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.
After a script ends the camera soft-reboots and its sequence resets to 0. The host dropped the camera's reply because of the sequence mismatch, and stdout events kept resetting the timeout, so it hung. Separately, stop() returned before the script had exited, so a script uploaded right after could be thrown away when the old one exited.
This still requires firmware fixes.