-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Kafka Snappy library fails to load when restarting Quarkus in the same JVM #39767
Comments
/cc @alesj (kafka), @cescoffier (kafka), @ozangunalp (kafka) |
This commit introduces a solution for loading the Snappy native library across multiple test profiles. Due to the constraint that native libraries can only be loaded from a single classloader, a shared classloader is now utilized for loading Snappy in test mode. Please note, this feature is exclusively applicable when running tests. Fixes: quarkusio#39767
Java has the restriction that a native library can only be loaded by a single classloader. Unfortunately, we cannot change that behavior. When using a test profile, you end up with 2 classloaders, which leads to the issue. I've added a way to handle this situation in #40304. You would need to add the following property to your
|
This commit introduces a solution for loading the Snappy native library across multiple test profiles. Due to the constraint that native libraries can only be loaded from a single classloader, a shared classloader is now utilized for loading Snappy in test mode. Please note, this feature is exclusively applicable when running tests. Fixes: quarkusio#39767
Hi, will this be backported to 3.8 (we want to stick with LTS versions)? Thanks, lorenzo |
I would consider that as a feature so normally we do not backport them. But, it can also be seen as a bug fix. It should be backportable - and let's see if it can be done. Note that 3.15 is the next LTS, and will be released soonish (CR1 is already out) |
@cescoffier triage/backport* labels may not be added to an issue. Please add them to the corresponding pull request. This message is automatically generated by a bot. |
Describe the bug
I have a project where the tests run with multiple test profiles, which causes a new Quarkus instance for each group of tests (but I believe it's still the same JVM instance). However, the Snappy library that is being loaded cannot be loaded the second time since there is still a lock on the snappyjava.dll file (I think the OS keeps a lock since it's loaded in as a DLL)
Expected behavior
Snappy loads successfully each Quarkus startup
Actual behavior
The first time Quarkus starts up successfully. The second time Quarkus starts up, I get the following exception:
How to Reproduce?
quarkus.kafka.snappy.enabled=true
@QuarkusTest
and a different@TestProfile
Output of
uname -a
orver
Microsoft Windows [Version 10.0.22631.3296]
Output of
java -version
openjdk 20.0.1 2023-04-18 OpenJDK Runtime Environment (build 20.0.1+9-29) OpenJDK 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)
Quarkus version or git rev
3.8.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Additional information
No response
The text was updated successfully, but these errors were encountered: