In my project, I used mongodb with repliset mode( host:30000 & host:30001).
my program connect mongodb with nginx stream agent( host:62010 & host:62011)
when I use springboot 2.6.3, it works fine. but when I upgrade to 2.6.4 or higher (etc: 2.6.6), there is a exception (RejectedExecutionException) on springboot application init. ( direction connect to mongodb without by nginx agent, works fine)
After track this exception, I found there are 5 step: 1. MongoDB driver will check config and try to connect host:62010&62011 2. MongoDB driver will put these host to manager pool. 3. MongoDB driver will find the real host behind nginx and try to connect host:30000 & host:30001 4. MongoDB driver will put these host to manager pool. 5. MongoDB driver will try to remove host:62010&host:62011 due to it was nginx agent address when run on step 5, the exception was throw. seems like when driver try to remove something from a ScheduledThreadPoolExecutor and find that executor was already terminated.
First I think mongodb's driver upgrade cause it. I try to switch springboot 2.6.6 with spring-boot-starter-data-mongodb 2.6.3, But the exception still here.
So I think maybe there is a bug cause mongodb synchronized lock doesn't work after springboot 2.6.4 plz check it, thanks very much. log.log
Comment From: bclozel
See https://github.com/spring-projects/spring-framework/issues/28354#issuecomment-1101262507 Did you confirm that rolling back the driver version works as suggested in my previous comment? The logs you've attached do not contain the exception shown in the screenshot. Does this look like a consequence of JAVA-4471? In any case, it doesn't seem like the stacktrace contains any Spring class, so I'm closing this issue.
Feel free to reopen it if you manage to find that this is related to Spring Boot after all.