Add a que for multimessages - #64
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a send-queue mechanism to the J1939-21 transport-protocol path so multi-packet messages triggered while another transfer is active can be buffered and sent later, reducing the need for application-side flow control.
Changes:
- Introduced a new
_snd_questructure to buffer pending multi-packet sends. - Refactored multi-packet send initialization into a new helper (
_put_multi_msg). - Added queue-draining logic to
async_job_threadto start a queued transfer once sending becomes idle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
When i have time i can add some tests. Atm I have this change active in our production setup because otherwise when i trigger multiple multimessages simultaniously only the first will be send the others will get stuck. Maybe it should be an optional parameter? |
|
The interlock was not present in my old version, it should now also work with this interlock. |
|
How can we retrigger the tests? They should pass now |
I retriggered them a little while ago, it seems they are still hanging. I'm not seeing any recent commits besides when Raul caught the branch up with main, did you make any other changes? The tests should rerun when you commit a change to the branch |
|
I made these changes: |
|
Can i somehow find out why the checks do fail? |
I'm not sure if there's a great way outside of trying to make a setup to run the tests locally the same way they are ran on the runners. From looking at the traces, if I had to guess I would think we are hitting some sort of deadlock where something is hanging indefinitely. |
@kellergoech looks like one scenario from pytest is stuck: test -->https://github.com/RaulSMS/python-can-j1939/blob/master/test/test_dtc_conversion_methods.py
you can try to run the test on your local setup
This guide should also help. |
|
although it is quite strange because you did not touch anything related to conversion methods as far as I could see |
|
For comparison, this is a green run: |
@kellergoech actually now that I gave a second look, it is probably hanging on https://github.com/RaulSMS/python-can-j1939/blob/master/test/test_ecu.py |
|
@kellergoech @khauersp I can confirm it is hanging on test_ecu.py here the findings from Claude, I have not review them, do you think this make sense: CLAUDE reviewReview:
|
|
Will look into it. |


The que will buffer messages when these are triggered while sending of another message is still active. The que will be overwritten by new messages when sending is not active.
-> Therefore the application which uses this function does not need to care about the state of the send buffer.