-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web容器启动时刷新最新配置失败 #1134
Comments
yanrongzhen
added a commit
to yanrongzhen/hippo4j
that referenced
this issue
Mar 21, 2023
Merged
magestacks
pushed a commit
that referenced
this issue
Apr 11, 2023
…ool under the Config mode. (#1133) * Add notification logic after modifying web thread pool parameters. * Refactor the notification module to enable notification capability for the web container. * Add application profile enum. * Revert the bugfix changes and split them into issue #1134. * Revert @order annotation in AbstractWebThreadPoolService. * fix profile enum name with test environment. * Fix: remove unused imports. * Delete ProfileEnum class. * Modify the way of obtaining the ID of the web thread pool. * Move the IExecutorProperties class to the common module. * Narrow the scope of @SuppressWarnings annotation usage.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BUG 报告
你使用了哪个项目?
hippo4j config
你使用了哪个版本?
1.5.0-SNAPSHOT
预期行为
内存中Web Executor 成功更新至最新参数
实际行为
空指针
原因分析(如果可以)
cn.hippo4j.adapter.web.AbstractWebThreadPoolService
类实现了ApplicationRunner, 用于在启动后(run方法)从上下文当中获取嵌入式Web容器, 再获取其中的线程池. 但是由于没有指定优先级, 比cn.hippo4j.config.springboot.starter.refresher.AbstractConfigThreadPoolDynamicRefresh
执行的晚, 导致在启动时收到配置变更信息时,cn.hippo4j.adapter.web.AbstractWebThreadPoolService
当中的web容器线程池为空, 报空指针异常, 刷新失败.问题重现步骤
WebExecutorRefreshListener
当中调用cn.hippo4j.adapter.web.WebThreadPoolService#getWebThreadPoolParameter
方法会出现NPE异常解决方案
使用@order注解, 指定获取Web容器线程池的
AbstractWebThreadPoolService
为最先执行的ApplicationRunnerThe text was updated successfully, but these errors were encountered: