Closed refeccd closed 7 months ago
Thanks for the report. Unfortunately, as things stand, there are too many unknowns for us to efficiently investigate the problem. Can you please provide a complete example that reproduces it?
I also wish I could provide an EXAMPLE, unfortunately this error it is not 100% reproducible. As it stands, the problem is more likely to occur when the application is running a little longer. If it's just restarted right after a short period of time, it's hardly ever reproducible!
I'll try to see if I can provide a 100% reproduction of the demo Is there anything else I should provide other than a demo?
I'm afraid we really need a demo as it's very hard to diagnose a problem that we cannot reproduce.
Okay, I'll try to provide a minimal reproduction of the example
I did my best to try to provide an example that could be reproduced consistently, but it is completely unreproducible on my own computer. But on CentOS 7.9, it will fail to terminate properly without any regularity
I think my problem is very similar to #38930, the difference is that I'm using the latest SpringBoot 3.2.4
Yes, it does look similar to #39930. Unfortunately, that doesn't help us here as no reproducer was provided there either. The class loading failures would suggest that either the class loader has been closed (that should not have happened at this point in the shutdown process) or the jar file has been deleted while the app is running. The latter's out of Spring Boot's control and, judging by your script above, should not be happening here. That leaves the class loader being closed too soon. To confirm or eliminate that possibility, I'm afraid we'll need something that reproduces the problem.
I am seeing a similar problem in an application that interrupts threads when workers need to rebalance. I am highly suspicious of https://github.com/spring-projects/spring-boot/issues/37668 but don't know where to start.
ClassNotFoundException
or NoClassDefFoundError
, but this is highly correlated to the timings of the interrupts.Is it possible that the interrupts are hitting the classloaders and breaking definition lookups? It would be a similar case to what is described here: https://stackoverflow.com/q/56866573/97964
How can I help trace this further?
I have reproduce this locally with our application, but I cannot share the internal business code that will do it. Here is the gist of the operations in the meantime:
Thread.interrupt()
). You probably need a lot of class loading to be happening to catch it at the right point in time.As another point of information, using the "classic" class loader seems to alleviate the issue on initial testing. I still have to verify this further to be certain that it's improved.
Thanks very much for the extra details @jocull. The Thread.interrupt()
details make me wonder if it's a similar underling cause as #38611
Yes, it appears like of #39930. However, we will get some help if it reproduce again.
I think I can see why this can happen, but I've not been able to replicate it. We're going to try changing the underlying way that we access file data.
@jocull @liaozan I've just pushed something I hope will fix this. If you have the chance, please try the SNAPSHOT before the Thursday release.
Please don't cross post. You've made the same comment in https://github.com/spring-projects/spring-boot/issues/42923#issuecomment-2446361233.
I am running SpringBoot 3.2.4 on jdk21. I wrote a startup script that stops the application gracefully and restarts it While stopping the application, the following error is reported
Here is the start script