-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Fix internal bug when amount of context exceeds the threshold #152
Conversation
- NullContext will take effect - Default context will be cached during initialization Signed-off-by: Eric Zhao <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
============================================
- Coverage 49.01% 48.97% -0.05%
Complexity 661 661
============================================
Files 122 122
Lines 4172 4180 +8
Branches 573 574 +1
============================================
+ Hits 2045 2047 +2
- Misses 1879 1883 +4
- Partials 248 250 +2
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
============================================
- Coverage 49.01% 48.97% -0.05%
Complexity 661 661
============================================
Files 122 122
Lines 4172 4180 +8
Branches 573 574 +1
============================================
+ Hits 2045 2047 +2
- Misses 1879 1883 +4
- Partials 248 250 +2
Continue to review full report at Codecov.
|
Signed-off-by: Eric Zhao <[email protected]>
fedc9c2
to
5b56ad3
Compare
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
============================================
+ Coverage 49.01% 50.05% +1.04%
- Complexity 661 672 +11
============================================
Files 122 122
Lines 4172 4193 +21
Branches 573 575 +2
============================================
+ Hits 2045 2099 +54
+ Misses 1879 1833 -46
- Partials 248 261 +13
Continue to review full report at Codecov.
|
} | ||
|
||
private static void initDefaultContext() { | ||
contextNameNodeMap.put(Constants.CONTEXT_DEFAULT_NAME, new EntranceNode( |
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.
Default Context should be child of ROOT, use Constants.ROOT.addChild(node)
to add.
@@ -75,8 +79,9 @@ protected void exitForContext(Context context, int count, Object... args) throws | |||
if (parent != null) { | |||
((CtEntry)parent).child = null; | |||
} | |||
if (parent == null) { | |||
// Auto-created entry indicates immediate exit. | |||
if (parent == null && !(context instanceof NullContext)) { |
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.
Check NullContext
at the beginning of this method, if current context is NullContext
, this method should return at once.
Signed-off-by: Eric Zhao <[email protected]>
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.
LGTM
…a#152) - When amount of context exceeds the threshold, the `NullContext` will be set to current thread local. Thus, when checking context in `CtSph#entry`, once `NullContext` detected, the entry will not do rule checking on the slot chain. - Cache the default context during initialization. Then when amount of context exceeds the threshold, entries under default context can do rule checking under default context. - Enhance the error message Signed-off-by: Eric Zhao <[email protected]>
Describe what this PR does / why we need it
Fix internal bug when amount of context exceeds the threshold.
Does this pull request fix one issue?
Fixes #151
Describe how you did it
NullContext
will be set to current thread local. Thus, when checking context inCtSph#entry
, onceNullContext
detected, the entry will not do rule checking on the slot chain.Describe how to verify it
See test cases.