Skip to content

feat: add DEBUG-level logs for SPI extension loading in ExtensionLoader#16231

Open
uuuyuqi wants to merge 1 commit intoapache:3.3from
uuuyuqi:extensionloader-log
Open

feat: add DEBUG-level logs for SPI extension loading in ExtensionLoader#16231
uuuyuqi wants to merge 1 commit intoapache:3.3from
uuuyuqi:extensionloader-log

Conversation

@uuuyuqi
Copy link
Copy Markdown

@uuuyuqi uuuyuqi commented Apr 20, 2026

What is the purpose of the change?

Add DEBUG-level observability to ExtensionLoader for diagnosing SPI extension loading issues without external tools.

Motivation: In environments with many internal SPI extensions across different versions, along with custom class-isolation frameworks, dependency conflicts or misconfiguration can cause extensions to be silently skipped or loaded with unexpected wrapper chains. Currently the only way to observe this is via Arthas or remote debugging, which has high operational cost. With these DEBUG logs, users can simply enable DEBUG level for org.apache.dubbo.common.extension.ExtensionLoader to get full visibility into the SPI loading process.

Changes:

  • Log when extension class scanning starts and finishes (with timing, loaded names, adaptive class, wrappers)
  • Log each SPI class loaded (adaptive/wrapper/extension), including source resource URL
  • Log when an extension instance is created, including applied wrapper classes
  • Log when an extension class is skipped due to missing @Activate(onClass=...) dependencies, with the specific missing class names
  • Refactor loadClassIfActive to findMissingOnClass to return missing class names for diagnostic output

All logs are guarded by isDebugEnabled(), no performance impact in production.

Fixes #16230

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction.
  • Make sure GitHub actions can pass.

🤖 Generated with [Qoder][https://qoder.com]

Change-Id: I9775997a1233f13a1faead1391ee01b743796c6d
Co-developed-by: Qoder CLI <noreply@qoder.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 94.44444% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.78%. Comparing base (d95086c) to head (8fc12fd).

Files with missing lines Patch % Lines
...apache/dubbo/common/extension/ExtensionLoader.java 94.44% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16231      +/-   ##
============================================
- Coverage     60.79%   60.78%   -0.01%     
- Complexity    11751    11769      +18     
============================================
  Files          1953     1953              
  Lines         89119    89164      +45     
  Branches      13444    13454      +10     
============================================
+ Hits          54179    54199      +20     
- Misses        29369    29389      +20     
- Partials       5571     5576       +5     
Flag Coverage Δ
integration-tests-java21 32.13% <94.44%> (-0.04%) ⬇️
integration-tests-java8 32.29% <94.44%> (+0.09%) ⬆️
samples-tests-java21 32.19% <94.44%> (+0.06%) ⬆️
samples-tests-java8 29.89% <94.44%> (+0.03%) ⬆️
unit-tests-java11 59.02% <85.18%> (-0.01%) ⬇️
unit-tests-java17 58.53% <85.18%> (-0.02%) ⬇️
unit-tests-java21 58.54% <85.18%> (+0.02%) ⬆️
unit-tests-java25 58.48% <85.18%> (+<0.01%) ⬆️
unit-tests-java8 59.02% <85.18%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add DEBUG-level logs for SPI extension loading in ExtensionLoader

2 participants