fix: do not read runtime-rule storage if the feature is disabled.#13890
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents the runtime-rule boot override resolver from touching storage when the receiver-runtime-rule module is not enabled, avoiding unnecessary DAO reads on MAL/LAL static rule load paths. It also hardens BanyanDB management-schema access to fail with a checked exception instead of an NPE, and introduces a no-op SessionCacheCallback for multi-write scenarios.
Changes:
- Short-circuit
DbOverrideRuntimeRuleResolver.loadAll(...)whenreceiver-runtime-ruleis disabled to avoid any storage/DAO access. - Add
requireManagementSchema(...)toBanyanDBStorageClientto throwIOExceptionwhen management metadata isn’t registered yet (instead of NPE). - Add
SessionCacheCallback.NOOPfor callers that must suppress cache updates (e.g., secondary backend in multi-write).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBStorageClient.java | Adds a checked-IOException guard around management schema lookup to avoid boot-time NPEs. |
| oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleProvider.java | Changes setter visibility for internal bootstrap fields (currently widens API surface). |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/SessionCacheCallback.java | Introduces a reusable no-op callback instance for suppressing cache updates. |
| oap-server/server-admin/runtime-rule/src/test/java/org/apache/skywalking/oap/server/receiver/runtimerule/extension/DbOverrideRuntimeRuleResolverTest.java | Adds coverage ensuring a disabled runtime-rule module doesn’t trigger storage reads. |
| oap-server/server-admin/runtime-rule/src/main/java/org/apache/skywalking/oap/server/receiver/runtimerule/extension/DbOverrideRuntimeRuleResolver.java | Skips DB override resolution entirely when the runtime-rule module is not loaded/enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wu-sheng
approved these changes
Jun 4, 2026
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.
No description provided.