Skip to content

Potential concurrence issue happens when updating rules #1782

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

Closed
vipweihua opened this issue Oct 6, 2020 · 0 comments · Fixed by #1783 · May be fixed by #1784
Closed

Potential concurrence issue happens when updating rules #1782

vipweihua opened this issue Oct 6, 2020 · 0 comments · Fixed by #1783 · May be fixed by #1784
Labels
kind/bug Category issues or prs related to bug.

Comments

@vipweihua
Copy link
Contributor

Issue Description

Type: bug report

Describe what happened (or what feature you want)

When you update rules, XXXRuleManager.XXXPropertyListener.configUpdate will be called, and it's not atomic action of calling clear() and putAll(). That could make it no rule in an instant.

Describe what you expected to happen

Whenever you call XXXRuleManager.getRules(), the rules should be initial ones or the updated ones, there should never be empty.

How to reproduce it (as minimally and precisely as possible)

  1. create a UT class for FlowRuleManager which contains a loader thread which is loading FlowRules again and again.
  2. in the man thread, just do getRules again and again.
  3. if the size happens to 0, there must be the issue.

Tell us your environment

None of env's business

Anything else we need to know?

I'll submit a UT later to prove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
2 participants