Aias00 opened a new issue, #6859:
URL: https://github.com/apache/shenyu/issues/6859

   ## Description
   Both `GrpcParser` and `DubboIngressParser` call 
`endpointsLister.namespace(namespace).get(serviceName)` and immediately 
dereference the result with `.getSubsets()` without a null check. If the 
referenced Service exists but has no Endpoints yet (common during rolling 
deployments, scale-down, or misconfiguration), the lister returns null and 
`.getSubsets()` throws NPE. The sibling parsers `DivideIngressParser` (line 
156-157) and `WebSocketParser` (line 155-156) correctly guard with `if 
(Objects.isNull(v1Endpoints))`.
   
   ## Location
   - 
`shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/GrpcParser.java:155-156,186-187`
   - 
`shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/DubboIngressParser.java:161-162,337-338`
   
   ## Impact
   Creating or updating a gRPC/Dubbo ingress whose backing Service has no ready 
Endpoints crashes the reconcile cycle with an unhandled NPE, preventing the 
ingress from being configured at all.
   
   ## Suggested fix
   Add `if (Objects.isNull(v1Endpoints)) { LOG.info("Endpoints {} not found", 
serviceName); return upstreamList; }` after each 
`endpointsLister...get(serviceName)`, mirroring `DivideIngressParser`.
   
   ## Related existing
   None — GOV-T6 (#6679) covers the parsers having zero tests; this is the 
concrete runtime NPE.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to