apache / apache/shenyu

[BUG] ApacheDubboPlugin NPE when DubboRuleHandle is absent/empty

Open Beginner friendly
#6,741 1 comment 0 reactions 0 assignees View on GitHub
plugin: apache-dubbo priority: medium type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- severity: Medium
- files: `shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/ApacheDubboPlugin.java:69-71`
- description: `RULE_CACHED_HANDLE.get().obtainHandle(rule.getId())` returns `null` when the rule handle is absent (cache miss, or rule arrives before handle sync). `CommonHandleCache.obtainHandle` returns null per its contract; `cachedHandle` refuses to store null values. Line 70 `dubboRuleHandle.getTimeout()` NPEs. Same pattern in `ApacheDubboGrayLoadBalance.java:54,57`.
- impact: A dubbo request for a rule whose handle hasn't been cached (timing race) throws NPE → 500.
- suggested_fix: Default to `DubboRuleHandle.newInstance()` when `obtainHandle` returns null, or null-check.
- confidence: Medium
- related_existing: none — #5802/#4665 are different paths.

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in ApacheDubboPlugin.java:69-71 and inspect CommonHandleCache.obtainHandle to confirm the documented null behavior. Compare the same pattern in ApacheDubboGrayLoadBalance.java:54,57, then verify that a missing or unsynchronized handle no longer causes an NPE or 500 response for a Dubbo rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.