BobSong-dev opened a new pull request, #6926:
URL: https://github.com/apache/shenyu/pull/6926

   Fixes #6786
   ## 背景
   
   客户端关闭时会尝试通过反射获取 JVM 的 shutdown hooks,用于延后其他关闭钩子的执行。
   
   在 Java 21 这类有模块访问限制的环境里,反射访问可能抛出
   `InaccessibleObjectException`。原来的逻辑只记录异常,后面仍会继续使用
   空的 hooks 对象,最终导致后台线程再次抛出 NPE。
   
   ## 修改内容
   
   反射访问失败或获取到的 hooks 为空时,记录告警后直接跳过延迟逻辑。
   
   这样在无法访问 JVM 内部 shutdown hooks 的环境中,会正常降级,而不会让
   关闭钩子线程异常退出。
   
   同时补充了回归测试,覆盖反射目标不可访问的场景。
   
   
   ## 验证
   
   已执行 `ShenyuClientShutdownHookTest`,测试通过。


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