Skip to content

task: report the serial of a command that failed - #4817

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:task-error-serial
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:task-error-serial

Conversation

@grandixximo

@grandixximo grandixximo commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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_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, 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 set failed_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.

Comment thread src/emc/task/emctaskmain.cc Resolved
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants