OpenHFT / Chronicle-Map

Replicate your Key Value Store across your network, with consistency, persistance and performance.
http://chronicle.software/products/chronicle-map/
Apache License 2.0
2.73k stars 467 forks source link

UnsatisfiedLinkError on createPersistedTo() using Java 21 inside a container #517

Closed Sax388 closed 4 months ago

Sax388 commented 4 months ago

Running the application inside a container throws this error on map creation:

Caused by: java.lang.UnsatisfiedLinkError: unknown
        at jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError(AsmRuntime.java:48)
        at net.openhft.posix.internal.jnr.JNRPosixInterface$jnr$ffi$0.fallocate64(Unknown Source)
        at net.openhft.posix.internal.jnr.JNRPosixAPI.fallocate(JNRPosixAPI.java:202)
        at net.openhft.chronicle.hash.impl.util.jna.PosixFallocate.fallocate(PosixFallocate.java:18)
        at net.openhft.chronicle.hash.impl.VanillaChronicleHash.fallocate(VanillaChronicleHash.java:1107)
        at net.openhft.chronicle.hash.impl.VanillaChronicleHash.map(VanillaChronicleHash.java:1092)
        at net.openhft.chronicle.hash.impl.VanillaChronicleHash.createMappedStoreAndSegments(VanillaChronicleHash.java:513)
        at net.openhft.chronicle.map.ChronicleMapBuilder.createWithNewFile(ChronicleMapBuilder.java:1849)
        at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1747)
        at net.openhft.chronicle.map.ChronicleMapBuilder.createPersistedTo(ChronicleMapBuilder.java:1588)

This started to appear when a new Java 17 version (eclipse-temurin:17-jdk-alpine) came out around 2024-01-26. I tested the same on eclipse-temurin:21-jdk-alpine now and it's the same. Locally it works fine but it clashes in the container.

The respective call is

ChronicleMapBuilder
    .simpleMapOf(String.class, Metadata.class)
    .entries(PRE_ALLOCATION_SIZE)
    .maxBloatFactor(1_000)
    .createPersistedTo(Files.createTempFile(dir, prefix, suffix);
Sax388 commented 4 months ago

This doesn't happen, when using eclipse-temurin:21-jdk. I'm closing it to not waste your resources on a smaller image size.