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
LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "net/openhft/chronicle/queue/JDBCResultBinarylightMethodWriter" #176
Comments
I've applied the following code to the develop branch
in here
@JanStureNielsen I can't release this branch at the moment, but if you could review this change and let me know if it fixes it for you, regards. |
Thanks for looking at this so quickly @RobAustin! Curiously, the race-to-define always fails for |
As I’m sure you’re already aware we use code generation, and you have a use case where it is attempting to create the same class into different threads and at the same time ( and into the the same class loader). The code that Is doing the code creation checks to see if the class already exist, and if it does not exist it then goes ahead and creates it.
We could make it thread safe and add synchronisation, but even if we did this, we Would have to be careful of the different class loaders. This may prevent the race but with the possibility of different class loaders it could be tricky to get correct and I was keen not to add an extra layer of blocking, and given it is a rare event I opted to instead catch the duplicate class and then just use the existing class. As this is somewhat simpler than synchronisation. I’m not sure this fully answered your question about why it is happening but all I can say is I saw it was happening and I think that I may have fixed it.
… On 18 Jul 2020, at 14:12, Jan Nielsen ***@***.***> wrote:
Thanks for looking at this so quickly @RobAustin! Curiously, the race-to-define always fails for JDBCStatementBinarylightMethodWriter -- why is it always that class? I've made two additional comments in 85fb5ba.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Closing as #177 is merged. |
Released in Chronicle-Wire-2.20.101, BOM-2.20.134 |
The Chronicle Queue JDBC test code:
appears to fail with:
starting with:
up to and including the latest version 2.19.360. Prior to that, version 2.19.290 appears to work.
The text was updated successfully, but these errors were encountered: