-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix case where MongoDB and MariaDB extensions fail in native #8788
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
Conversation
|
If you think I should add a new test containing these two extensions, I can obviously do that. |
| } | ||
|
|
||
| @TargetClass(com.sun.jna.Native.class) | ||
| final class JnaNativeSubstitutions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this substitution targets a class which isn't MongoDB specific, does it belong here?
My concern is that if such subtitutions are kept within an extension, then they will eventually conflict with other extensions.
I guess it could be acceptable as a temporary solution, if there's an issue tracking a further improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the ideal situation would be to have a jna extension that does these substitutions just like we have with Netty.
That's probably a good thing to follow up with - an easy thing for someone to contribute as their first contribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually put that ones in core considering they are targetting JDK classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a JDK class however. It's coming from this dependency:
Line 1786 in 6a612a8
| <groupId>net.java.dev.jna</groupId> |
| public class SimpleSocketHandlerFunction implements SocketHandlerFunction { | ||
| @Override | ||
| public Socket apply(Options options, String host) throws IOException { | ||
| return Utils.standardSocket(options, host); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this perhaps log a warning or throw an exception if a MariaDB feature is being disabled?
We shouldn't silentily ignore configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea yeah! Throwing an exception I think it the proper way to go. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
funny, was checking the changes in the MariaDB driver and it seems this odd JNA comment in the MariaDB driver was actually introduced precisely to improve GraalVM AOT.. :) Looks good! |
|
ok well was going to merge but @gsmet preceded me. One really can't spend an extra minute checking details |
|
Thanks folks |
Fixes: #8785