We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
程序会监控线程池中每个任务的执行时间,如果执行时间超过了executeTimeOut,就会异步发送任务超时警告,执行ThreadPoolNotifyAlarmHandler类的asyncSendExecuteTimeOutAlarm方法。但如果此线程池在创建的时候,在DynamicThreadPoolPostProcessor类的postProcessAfterInitialization方法中向服务端请求该线程池的配置参数时发生错误。就会导致此线程池对应的threadPoolNotifyAlarm未被放入GlobalNotifyAlarmManage的NOTIFY_ALARM_MAP当中,进而导致在异步发送任务超时警告ThreadPoolNotifyAlarmHandler类的asyncSendExecuteTimeOutAlarm方法时,发生空指针异常
executeTimeOut
ThreadPoolNotifyAlarmHandler
asyncSendExecuteTimeOutAlarm
DynamicThreadPoolPostProcessor
postProcessAfterInitialization
threadPoolNotifyAlarm
GlobalNotifyAlarmManage
NOTIFY_ALARM_MAP
相关代码:
ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId);// null if (!threadPoolNotifyAlarm.getIsAlarm()) { return; }
异常如下:
Exception in thread "message-consume-3" java.lang.NullPointerException at cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler.asyncSendExecuteTimeOutAlarm(ThreadPoolNotifyAlarmHandler.java:171) at cn.hippo4j.core.executor.DynamicThreadPoolExecutor.afterExecute(DynamicThreadPoolExecutor.java:100) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
The text was updated successfully, but these errors were encountered:
空指针的优化 (opengoofy#188)
246ba7f
Merge pull request #189 from zhuanghaozhe/develop
c36d244
空指针的优化 (#188)
zhuanghaozhe
No branches or pull requests
程序会监控线程池中每个任务的执行时间,如果执行时间超过了
executeTimeOut
,就会异步发送任务超时警告,执行ThreadPoolNotifyAlarmHandler
类的asyncSendExecuteTimeOutAlarm
方法。但如果此线程池在创建的时候,在DynamicThreadPoolPostProcessor
类的postProcessAfterInitialization
方法中向服务端请求该线程池的配置参数时发生错误。就会导致此线程池对应的threadPoolNotifyAlarm
未被放入GlobalNotifyAlarmManage
的NOTIFY_ALARM_MAP
当中,进而导致在异步发送任务超时警告ThreadPoolNotifyAlarmHandler
类的asyncSendExecuteTimeOutAlarm
方法时,发生空指针异常相关代码:
异常如下:
The text was updated successfully, but these errors were encountered: