-
Notifications
You must be signed in to change notification settings - Fork 41k
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
NoClassDefFoundError can be thrown from LaunchedClassLoader when threads are interrupted #40096
Comments
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. |
I'll try to see if I can provide a 100% reproduction of the 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 #37668 but don't know where to start.
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:
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. |
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. |
Rename the internal `FileChannelDataBlock` to `FileDataBlock` since we want to fallback to a `RandomAccessFile` when a thread is interrupted. See gh-40096
@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. |
This comment was marked as duplicate.
This comment was marked as duplicate.
How does version 2.6.13 solve this? |
@Liesport758 the issue appeared with 3.2.0 and was fixed in 3.2.5. There is no link with 2.6.x. If you encounter a similar problem with this version, please upgrade first to a supported version as this generation is out of support. |
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
The text was updated successfully, but these errors were encountered: