OpenHFT/Posix

PosixAPI.posix().fallocate can't create file in containerd.

Closed this issue · 3 comments

dhyuan commented

hi team,
The following code can work well in docker but fail in containerd. Is there any plan to make this lib compatibility with containerd? Thanks!

    createFile("/tmp/myTestchronicleMapFile");
    ... ...
    
    private static void createFile(String fileName) throws IOException {
        PosixAPIHolder.loadPosixApi();
        File file = new File(fileName);
        final File canonicalFile = file.getCanonicalFile();
        final RandomAccessFile raf = CanonicalRandomAccessFiles.acquire(canonicalFile);
        FileDescriptor fd = raf.getFD();
        int ret = PosixAPI.posix().fallocate(getNativeFileDescriptor(fd), 0, 0, 1024);
        if (ret != 0) {
            throw new IOException("posix_fallocate() returned " + ret);
        }
    }

The error occurs at 'PosixAPI.posix().fallocate()'. Because the Chronicale-Map depends on this lib, the Chronicle-Map can not run in containerd. Since the K8S 1.24 replaces the Docker with the containerd, so the Chronicle-Map can not be used in Kubernetes whose version is above/equal to the 1.24.

tgd commented

Hi @dhyuan thanks for your feedback on this. To help us isolate this please can you provide the following:

  • Include a stacktrace or any error log output that may help
  • Share with us a representative Dockerfile that can help reproduce, if you are not able to share the full file please let us know what Java version you are using inside the container
  • What image is your Dockerfile based on?
  • What host operating system are you running on?
  • What vendor distribution of Kubernetes are you running on?
  • Which version of Chronicle-Map / Chronicle-Posix are you using?

Thanks

tgd commented

Hi @dhyuan

I've brought this code up in a local minikube instance on Ubuntu but cannot reproduce your issue yet. Once you have provided some more information about your various software/tool versions we can attempt to reproduce again.

Here are the versions used for the reproduction on our side:

Software Version
Chronicle Posix 2.24ea5
Host O/S Ubuntu 22.04.2 LTS
Host JDK openjdk version "1.8.0_302"
Docker image JDK openjdk:8-jdk-alpine
k8s distribution minikube version: v1.31.0 (using k8s 1.27.3)
containerd 1.6.12-0ubuntu1~22.04.3
tgd commented

Closing this ticket out as never heard back. If the issue persists please let us know.