fix(server):fix graph server cache notifier mechanism#2729
Merged
simon824 merged 3 commits intoapache:masterfrom Apr 2, 2025
Merged
fix(server):fix graph server cache notifier mechanism#2729simon824 merged 3 commits intoapache:masterfrom
simon824 merged 3 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the graph server cache notifier mechanism by introducing a controlled registration of cache listeners via static maps and enhancing logging during cache event processing.
- Introduces static ConcurrentHashMaps (graphCacheListenStatus and storeEventListenStatus) for managing listener registration.
- Updates listener registration and unregistration in CachedGraphTransaction using the new maps.
- Enhances logging in the AbstractCacheNotifier in StandardHugeGraph for better traceability.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java | Added static maps for tracking cache listener registration. |
| hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CachedGraphTransaction.java | Updated cache and store event listener registration/unregistration using static maps. |
| hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java | Enhanced logging within the cache notifier for improved debugging. |
Comments suppressed due to low confidence (1)
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CachedGraphTransaction.java:194
- Using static ConcurrentHashMaps to track listener registration may cause unintended unregistrations if multiple CachedGraphTransaction instances share the same graph name. Consider implementing a reference counting mechanism or a more granular registry to ensure that an active listener is not removed prematurely.
String graphName = this.params().name();
imbajin
approved these changes
Apr 1, 2025
simon824
approved these changes
Apr 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #2728