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

   ### Current Behavior
   
   `DubboIngressParser` can throw `NullPointerException` when an ingress 
backend references a service that currently has no `Endpoints` object.
   
   Other parsers such as `DivideIngressParser` check the result of 
`endpointsLister.namespace(namespace).get(serviceName)` and return an empty 
upstream list when endpoints are missing. The Dubbo parser does not have that 
guard:
   
   ```java
   V1Endpoints v1Endpoints = 
endpointsLister.namespace(namespace).get(serviceName);
   List<V1EndpointSubset> subsets = v1Endpoints.getSubsets();
   ```
   
   If Kubernetes has not created endpoints for the referenced service yet, 
`v1Endpoints` can be `null` and reconciliation fails with NPE.
   
   ### Expected Behavior
   
   Dubbo ingress parsing should handle missing endpoints the same way as the 
divide/websocket parsers: log the missing endpoints and return an empty 
upstream list, allowing a later reconcile to pick up endpoints when they appear.
   
   ### Steps to Reproduce
   
   1. Create a Dubbo ingress that references a service before that service has 
endpoints.
   2. Let the Shenyu Kubernetes controller reconcile the ingress.
   3. `DubboIngressParser.parseUpstream()` dereferences `v1Endpoints` and can 
throw.
   
   ### Code Location
   
   - 
`shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/DubboIngressParser.java`
     - `parseUpstream()` reads `v1Endpoints.getSubsets()` without a null check.
   


-- 
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