-
Notifications
You must be signed in to change notification settings - Fork 438
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
[ISSUES 111]Flow rule cache/check #253
Conversation
Codecov Report
@@ Coverage Diff @@
## master #253 +/- ##
==========================================
+ Coverage 43.06% 43.48% +0.41%
==========================================
Files 79 79
Lines 3994 3997 +3
==========================================
+ Hits 1720 1738 +18
+ Misses 2009 1997 -12
+ Partials 265 262 -3
Continue to review full report at Codecov.
|
core/flow/rule_manager.go
Outdated
return nil | ||
} | ||
|
||
// LoadRules loads the given flow rules to the rule manager, while all previous rules will be replaced. | ||
func LoadRules(rules []*Rule) (bool, error) { | ||
// TODO: rethink the design | ||
if isEqual := reflect.DeepEqual(currentRules, rules); isEqual { | ||
return isEqual, errors.New("The current Rules is the same as the rules to be loaded") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should return false, nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@sczyh30 How do you think about this design? |
Could you please solve conflicts? |
# Conflicts: # core/flow/rule_manager.go # core/flow/rule_manager_test.go
…ng into flow_rule_cache # Conflicts: # core/config/config.go # core/flow/slot.go # core/flow/slot_test.go # core/flow/standalone_stat_slot.go # core/flow/tc_default.go # core/flow/traffic_shaping.go # core/isolation/slot.go # core/log/metric/writer.go # core/stat/stat_slot.go # example/isolation/concurrency_limitation_example.go # ext/datasource/file/refreshable_file.go # ext/datasource/helper_test.go # ext/datasource/nacos/nacos_test.go # logging/logging.go
Describe what this PR does / why we need it
In order to avoid the meaningless updates to the property, downstream of property manager should
cache last update value to check consistency.
Does this pull request fix one issue?
Fix:#111
Describe how you did it
Using reflect.deepequal,maybe we need to think about performance
Describe how to verify it
ut
Special notes for reviews