Deadlock reading the object model from a plugin
-
Hello,
I am developping a interception plugin on my duet, and I am experiencing occasional deadlocks when reading from the object model, which cause some prints to hang forever.
More details:
- My plugin intercepts some GCode meta-commands and must retrieve a sensor value using a call to
CommandConnection.get_object_model()
from thedsf-python
package. - Most of the time, this just works, but sometimes, it hangs forever, causing the print to never resume because it is stuck in my plugin.
- When it happened, I checked the logs using
sudo journalctl -u duetcontrolserver -r
, and I got the following suspicious lines:
Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel) Oct 04 09:02:35 alpha DuetControlServer[29146]: [warn] Resending packet #0 (request GetObjectModel)
I suspect that the command to retrieve the object model is stuck in a deadlock, which sounds like a synchronization issue.
I have tried to call
CommandConnection.sync_object_model()
before retrieving the object model, but the deadlock also occured once in that case.Do you have any ideas on how to solve this issue ?
Do you think that I am doing something wrong, or could it be an issue in the firmware ?
In that case, should I update it to the latest version (3.5.3) ?Thank you very much for your help!
Antoine
- My plugin intercepts some GCode meta-commands and must retrieve a sensor value using a call to
-
@Ant1 I think you will need @chrishamm to have a look at this issue.
Ian