Skip to content

task: report a queued MDI as not idle - #4949

Merged
grandixximo merged 1 commit into
LinuxCNC:masterfrom
grandixximo:g282-mdi-wait
Dec 2, 2026
Merged

grandixximo merged 1 commit into
LinuxCNC:masterfrom
grandixximo:g282-mdi-wait

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

tests/interp/g28.2/invalid-pword failed on the i386 package job of #4942 (https://github.com/LinuxCNC/linuxcnc/actions/runs/46831805320/job/143290469047): "coordinated motion did not survive the rejected Pn (X stayed at 0.9999999999999999)".

When task is busy, it queues an incoming MDI and runs it later, but the status that echoes the command still showed the interpreter idle. A client that sends an MDI and waits for idle, like this test, then reads the machine before the command has run. Task now reports a queued MDI as reading, as it does for one it runs straight away.

Under load (runtests -j 8 with 8 CPU hogs, in a sandbox) the test as it is on master failed 6 times in 220 runs, and passed all 220 with this change. The full runtests suite passes.

When an MDI arrives while task is still busy, for instance with the
cleanup after an abort, task puts it in its MDI queue and runs it later.
The status that echoes the command still showed the interpreter idle,
so a client that sends an MDI and then waits for idle returned at once
and read the machine before the command had run.
tests/interp/g28.2/invalid-pword did exactly that and failed on the i386
CI job of LinuxCNC#4942: "coordinated motion did not survive the rejected Pn (X
stayed at 0.9999999999999999)", X still at 1 from the G0 X1 before.

Task now sets the interpreter state to reading when it queues an MDI, as
it does when it runs one straight away. It goes back to idle once the
queued command has run, as before.

The test no longer sleeps after its mode switches: task applies a mode in
the cycle that echoes it, so the next command already sees it.

Tested in a sandbox under load, runtests -j 8 with 8 CPU hogs: the test
as it is on master failed 6 times in 220 runs, and passed 220 of 220 with
this change; the test from this commit passed 240 of 240. The full
runtests suite passes.
@grandixximo
grandixximo merged commit 0abf419 into LinuxCNC:master Dec 2, 2026
19 checks passed
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.

1 participant