You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/04 02:49:01 UTC
[I] [BUG] IngressReconciler dereferences v1Ingress before null check — NPE on every ingress deletion (delete cleanup is dead code) [shenyu]
Aias00 opened a new issue, #6836:
URL: https://github.com/apache/shenyu/issues/6836
## Description
In `reconcile()`, line 134 fetches `v1Ingress` from the ingress lister. When an ingress is deleted from k8s, the lister no longer has it, so `v1Ingress` is null. Line 136 (`Map<String,String> annotations = v1Ingress.getMetadata().getAnnotations();`) dereferences `v1Ingress` **before** the null check on line 138 (`if (Objects.isNull(v1Ingress))`). The NPE propagates up and the entire delete-cleanup block (lines 138–161: selector/rule/SSL cleanup, cache invalidation) is never reached.
## Location
- `shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/reconciler/IngressReconciler.java:134-161`
## Impact
Deleting a ShenYu ingress leaves orphaned selectors, rules, metadata, SSL config, and service-ingress cache entries in the gateway. The ingress appears gone from k8s but the gateway still routes to the old upstreams. The delete path is effectively dead code.
## Suggested fix
Move line 136–137 (`annotations` fetch + `enablePluginsBasedOnAnnotations`) to after the `Objects.isNull(v1Ingress)` check — they should only run when `v1Ingress` is non-null (the create/update path).
## Related existing
Distinct from #6598 (http:// hardcode) and GOV-T6 (#6679, parser/reconciler zero-test). GOV-T6 notes `IngressReconciler` has no tests; this NPE is the root defect those missing tests would have caught.
--
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: notifications-unsubscribe@shenyu.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] IngressReconciler dereferences v1Ingress before null check — NPE on every ingress deletion (delete cleanup is dead code) [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6836: [BUG] IngressReconciler dereferences v1Ingress before null check — NPE on every ingress deletion (delete cleanup is dead code)
URL: https://github.com/apache/shenyu/issues/6836
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] IngressReconciler dereferences v1Ingress before null check — NPE on every ingress deletion (delete cleanup is dead code) [shenyu]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6836:
URL: https://github.com/apache/shenyu/issues/6836#issuecomment-5174030978
👋 Hello @yuluo-yx
A new issue has been opened by @Aias00:
- **Title**: [BUG] IngressReconciler dereferences v1Ingress before null check — NPE on every ingress deletion (delete cleanup is dead code)
- **Link**: https://github.com/apache/shenyu/issues/6836
Please review when you have time. Thank you! 🙏
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] IngressReconciler dereferences v1Ingress before null check — NPE on every ingress deletion (delete cleanup is dead code) [shenyu]
Posted by "hengyuss (via GitHub)" <gi...@apache.org>.
hengyuss commented on issue #6836:
URL: https://github.com/apache/shenyu/issues/6836#issuecomment-5421520689
/assign
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org