Repository navigation
task: report the serial of a command that failed - #4817
Open
grandixximo wants to merge 1 commit into
Open
grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
grandixximo
force-pushed
the
task-error-serial
branch
from
November 10, 2026 06:49
b17b4d2 to
6217e1d
Compare
BsAtHome
reviewed
Nov 10, 2026
A motion or IO error, such as a G38.2 that ends without contact, shows as an error in the status for one task cycle only, so a client waiting for the command usually missed it: wait_complete() returned done, and linuxcncrsh answered ACK or NAK to the same probe by luck. Task now keeps the serial of the last command that failed in task.failedSerial (stat.failed_serial in Python, -1 for none). wait_complete(), shcom, halui and linuxcncrsh report an error when it matches their command. The status itself is unchanged. tests/stale-motion-status slow-controller checks wait_complete() and failed_serial on no-contact probes; the linuxcncrsh test now always answers NAK to its three.
grandixximo
force-pushed
the
task-error-serial
branch
from
November 10, 2026 08:29
6217e1d to
0e14114
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.
A command that fails in motion or IO, such as a G38.2 that ends without contact, shows as an error in the status for one task cycle only. A client waiting for the command usually misses it:
wait_complete()returns done, and linuxcncrsh answers ACK or NAK to the same probe by luck, which is the flake seen in #4782.Task now keeps the serial of the last command that failed in a new status field,
failed_serialin Python (-1 for none).wait_complete(), shcom, halui and linuxcncrsh report an error when it matches their command. The status itself is unchanged, so code that waits for it to be done behaves as before.This adds a field to NML. I think it is worth having before NML is replaced: which command failed is per-command information, and the bridge in #4786 could use it to acknowledge a failed command.
Test: tests/stale-motion-status slow-controller runs three no-contact probes after its program; each must return an error from
wait_complete()and setfailed_serial. Without the fix all three fail. late-controller skips them, as its 50 ms servo period makes probes slow. The linuxcncrsh test now always answers NAK to its three. Full suite 368/368.