openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

bridge: implement MSGQ to ZMQ bridge with subscriber-based publishing

Open deanlee opened this issue 1 year ago • 1 comments

resolve https://github.com/commaai/msgq/issues/282, only publish services that have subscribers.

Implemented an efficient MSGQ to ZMQ bridge using ZMQ's socket monitoring. The bridge connects to the MSGQ services requested by subscribers and publishes events only when subscribers are active. It enters a sleep state and closes all MSGQ sockets when no subscribers are available, ensuring minimal overhead and scalability.

deanlee avatar Jun 28 '24 13:06 deanlee

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

github-actions[bot] avatar Jun 28 '24 13:06 github-actions[bot]

This PR has had no activity for 14 days. It will be automatically closed in 3 days if there is no activity.

github-actions[bot] avatar Jul 27 '24 01:07 github-actions[bot]

@deanlee now PJ streaming looks rather choppy and sometimes skips a split second of data, can you take another look at this?

sshane avatar Aug 28 '24 22:08 sshane

@sshane I didn't find issue when reviewing the code. Running zmq=1 ./junggle.py --stream also appears to be normal.Has this problem always been present, or is it intermittent?

deanlee avatar Aug 29 '24 05:08 deanlee

I found the issue.looks like the old bridge has the same issue too.I'll fix it when back to my computer

deanlee avatar Aug 29 '24 07:08 deanlee