-
Notifications
You must be signed in to change notification settings - Fork 522
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(server) Fix cacheEventListener in CachedSystemTransactionV2 #2619
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2619 +/- ##
=============================================
- Coverage 46.84% 35.99% -10.86%
+ Complexity 343 302 -41
=============================================
Files 719 719
Lines 58465 58450 -15
Branches 7495 7491 -4
=============================================
- Hits 27387 21037 -6350
- Misses 28306 35087 +6781
+ Partials 2772 2326 -446 ☔ View full report in Codecov by Sentry. |
if (!schemaEventHub.containsListener(Events.CACHE)) { | ||
schemaEventHub.listen(Events.CACHE, this.cacheEventListener); | ||
} |
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.
Deleting these codes will cause the test to report the error: Not found listener for cache...
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.
thanks, i can't find the specific error information. could you tell me how to locate wehre the error occurred ?
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.
For detailed information, see the failed test case here 👉 https://github.com/apache/incubator-hugegraph/actions/runs/10431704040/job/28891653277?pr=2619
schemaEventHub.listen(Events.CACHE, this.cacheEventListener); | ||
} | ||
// Listen cache event: "cache.clear", ... | ||
MetaManager.instance().listenSchemaCacheClear((e) -> { |
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.
removing this.cacheEventListener will cause resource leak when unlistenChanges()
@@ -242,7 +251,19 @@ public <T> void listenGraphClear(Consumer<T> consumer) { | |||
} | |||
|
|||
public <T> void listenSchemaCacheClear(Consumer<T> consumer) { | |||
this.graphMetaManager.listenSchemaCacheClear(consumer); | |||
if (isListenerInitialized(SCHEMA_CLEAR_KEY)) { |
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.
not sure why registering listener when isListenerInitialized(), do you mean isListenerNotInitialized()?
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.
yes,it is isListenerNotInitialized()
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
close #2617
Use the listening mechanism of server ->pd to clear the local schema cache upon receiving schema change events from pd;