Fix ZMQ lost data when connection break issue#1059
Fix ZMQ lost data when connection break issue#1059liuh-80 wants to merge 17 commits intosonic-net:masterfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This change will verify with sonic-net/sonic-buildimage#23525 |
|
This PR depends on test case PR merge first: sonic-net/sonic-mgmt#20107 |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run Azure.sonic-swss-common |
|
/AzurePipelines run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
yue-fred-gao
left a comment
There was a problem hiding this comment.
Since IMMEDIATE=1 won't change zmq_connect behaviour, the PR is an incremental improvement over current behaviour. Approved.
|
PR validation blocked because a known validation pipeline issue, waiting for the issue fixed. |
|
I suspect the root cause might be a timing gap between the registration of the event handler in ZmqServer and ZmqConsumerStateTable. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fix ZMQ lost data when connection break issue
Why I did it
Gnmi configuration fails for the first dash object when DPU is powered off and powered back on due to zmq connection.
This is because ZMQ is reconnecting and note set ZMQ_IMMEDIATE flag.
How I did it
Set ZMQ_IMMEDIATE flag in ZMQ client to prevent data lost:
https://libzmq.readthedocs.io/en/latest/zmq_socket.html#:~:text=When%20a%20%27ZMQ_PUSH,are%20not%20discarded.
This flag will make ZMQ accept data only when server side ready.
Enable ZMQ_IMMEDIATE flag will not cause push ZMQ can't connect when ZMQ pull side not ready.
Work item tracking
How to verify it
Pass all test cases.
Verify with new test case: sonic-net/sonic-mgmt#20107
Which release branch to backport (provide reason below if selected)
Description for the changelog
Fix ZMQ lost data when connection break issue
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)