记录线程池打满异常
使用xxl-job进行分布式任务调度的坑,
由于优惠券到期提醒定时任务
系统会每天9点去查询提前一天过期的优惠券,当xxl-job执行任务时
调用对应服务的excute方法超时,当下个任务过来时,又去线程池中取线程执行,导致线程池打满,直接拒绝
java.util.concurrent.RejectedExecutionException:
Task com.xxl.job.admin.core.thread.JobTriggerPoolHelper$3@3911ea7d
rejected from java.util.concurrent.ThreadPoolExecutor@341c352f[Running,
pool size = 200, active threads = 200, queued tasks = 1000, completed tasks = 8838]