Skip to content

Fix the ZMQ producer/consumer table does not update changes to the database issue. #942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 8, 2024

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Nov 5, 2024

Why I did it

Fix a race condition bug: when deleting ZmqProducerStateTable immediately after setting/deleting data, the data is sent to ZMQ but not updated in the database.

How I did it

Verify and wait for the data update before the db update thread exits.

Work item tracking

How to verify it

Pass all test cases.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Fix the ZMQ producer/consumer table does not update changes to the database issue.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@liuh-80 liuh-80 requested a review from qiluo-msft November 5, 2024 10:19
@liuh-80 liuh-80 assigned ganglyu and unassigned ganglyu Nov 5, 2024
@liuh-80 liuh-80 requested a review from ganglyu November 5, 2024 10:19
p->set(testKey,values);
delete p;

sleep(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ut stable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's stable, 1second is enough

@liuh-80 liuh-80 merged commit acc4805 into sonic-net:master Nov 8, 2024
17 checks passed
VladimirKuk pushed a commit to Marvell-switching/sonic-swss-common that referenced this pull request Nov 20, 2024
…tabase issue. (sonic-net#942)

#### Why I did it
Fix a race condition bug: when deleting ZmqProducerStateTable immediately after setting/deleting data, the data is sent to ZMQ but not updated in the database.

#### How I did it
Verify and wait for the data update before the db update thread exits.

##### Work item tracking

#### How to verify it
Pass all test cases.

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111

#### Description for the changelog
Fix the ZMQ producer/consumer table does not update changes to the database issue.

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/SONiC/wiki/Configuration.
-->

#### A picture of a cute animal (not mandatory but encouraged)
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.

2 participants