Repository navigation
linuxcncrsh: wait for task to receive SET ESTOP and SET MACHINE - #4957
Open
grandixximo wants to merge 2 commits into
Open
grandixximo wants to merge 2 commits into
grandixximo wants to merge 2 commits into
Conversation
tests/t0/nonrandom failed once on an arm CI runner with every MDI line refused: "Machine must be 'ON' for SET MDI". SET ESTOP and SET MACHINE send the state command and then watch the motion heartbeat in task's status for the new state, giving up after one second without a heartbeat. On a state change the interpreter writes the parameter file and calls fdatasync(). On a slow disk that call can take seconds, and task publishes no status meanwhile, so the heartbeat stands still. linuxcncrsh then reported a failure for a command that task was still working on, went on to the next one, and the machine never came on. Wait for task to echo the command before watching the heartbeat. Tested by delaying that fdatasync() by 3.45 s with a preload shim: t0/nonrandom fails the same way as on CI without the change and passes with it.
BsAtHome
reviewed
Dec 3, 2026
emcTimeout is 0 in linuxcncrsh, so the wait added for SET ESTOP and SET MACHINE blocked every client for as long as task did not answer. Move it to a helper that waits at most 10 s, and use it in SET JOINT_HOME too, which watches the heartbeat the same way.
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.
tests/t0/nonrandom failed on the arm package job of #4955 with every MDI line refused: "Machine must be 'ON' for SET MDI".
SET ESTOPandSET MACHINEsend the state command, then watch the motion heartbeat in task's status and give up after one second without one. On an estop reset the interpreter rewrites the parameter file and callsfdatasync(); on a slow disk that takes seconds (task logged "main loop took 3.45 seconds" in that run), and task publishes no status meanwhile. linuxcncrsh NAKed both commands, the test does not check the reply, and the machine never came on.The fix waits for task to echo the command before watching the heartbeat.
I reproduced it by delaying that
fdatasync()by 3.45 s with anLD_PRELOADshim: without the change t0/nonrandom fails the same way, with it it passes. The linuxcncrsh-driven tests (t0, linuxcncrsh, linuxcncrsh-tcp, toolchanger, mdi-queue, motion/g0) pass on two CPUs under load.