Skip to content

fix: do not read runtime-rule storage if the feature is disabled.#13890

Merged
wankai123 merged 1 commit into
apache:masterfrom
wankai123:fix-runtimerule
Jun 4, 2026
Merged

fix: do not read runtime-rule storage if the feature is disabled.#13890
wankai123 merged 1 commit into
apache:masterfrom
wankai123:fix-runtimerule

Conversation

@wankai123
Copy link
Copy Markdown
Member

No description provided.

@wankai123 wankai123 added this to the 11.0.0 milestone Jun 4, 2026
@wankai123 wankai123 requested review from Copilot and wu-sheng June 4, 2026 06:36
@wankai123 wankai123 added the bug Something isn't working and you are sure it's a bug! label Jun 4, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...) when receiver-runtime-rule is disabled to avoid any storage/DAO access.
  • Add requireManagementSchema(...) to BanyanDBStorageClient to throw IOException when management metadata isn’t registered yet (instead of NPE).
  • Add SessionCacheCallback.NOOP for 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.

@wankai123 wankai123 merged commit bf0fe4b into apache:master Jun 4, 2026
431 of 434 checks passed
@wankai123 wankai123 deleted the fix-runtimerule branch June 4, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants