Skip to content

Pulsar Function jar file extraction fails when functions with large parallelism are created and /tmp is a mounted volume #12645

Closed

Description

@lhotari

Describe the bug

The fix made in #11343 to fix #11340/#11379 concurrency issues in NarUnpacker doesn't work when /tmp is a mounted volume (in a container). This is due to the fact that docker volumes don't support file locking across containers.

To Reproduce

Similar steps as there are for #11340/#11379 with the difference that /tmp/pulsar-nar is a mounted directory.

Expected behavior

It should be possible to configure Pulsar Functions to use another file locking solution that doesn't require operating system level file locking functionality. Alternatively it should be possible to configure the function instance to use a unique directory for the function instance instead of using the shared /tmp/pulsar-nar directory.
The extraction directory cannot be unique for each extraction since that would cause the disk space usage to grow when functions get started/restarted.

Error message

ERROR org.apache.pulsar.common.nar.NarUnpacker - There was a problem extracting the nar file. Deleting /tmp/pulsar-nar/functions.jar-unpacked/Zii1vei7Ohhaishu_Bohc6kaesaechoofeishaiN8 to clean up state.
java.io.FileNotFoundException: /tmp/pulsar-nar/functions.jar-unpacked/Zii1vei7Ohhaishu_Bohc6kaesaechoofeishaiN8/META-INF/MANIFEST.MF (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method) ~[?:?]
    at java.io.FileOutputStream.open(FileOutputStream.java:298) ~[?:?]
    at java.io.FileOutputStream.<init>(FileOutputStream.java:237) ~[?:?]
    at java.io.FileOutputStream.<init>(FileOutputStream.java:187) ~[?:?]
    at org.apache.pulsar.common.nar.NarUnpacker.makeFile(NarUnpacker.java:144) ~[java-instance.jar:?]
    at org.apache.pulsar.common.nar.NarUnpacker.unpack(NarUnpacker.java:127) ~[java-instance.jar:?]
    at org.apache.pulsar.common.nar.NarUnpacker.doUnpackNar(NarUnpacker.java:96) ~[java-instance.jar:?]
    at org.apache.pulsar.common.nar.NarUnpacker.unpackNar(NarUnpacker.java:65) ~[java-instance.jar:?]
    at org.apache.pulsar.common.nar.NarClassLoader.getFromArchive(NarClassLoader.java:153) ~[java-instance.jar:?]

Activity

  1. added
    type/bug
    on Nov 5, 2021
  2. added this to the 2.10.0 milestone on Nov 5, 2021
  3. eolivelli commented on Nov 8, 2021

    @eolivelli
    Contributor

    @lhotari I have posted a PR for branch-2.7
    #12665

    I will send a new PR for master/branch-2.8/branch-2.9, the code was moved

  4. eolivelli commented on Nov 8, 2021

    @eolivelli
    Contributor

    @lhotari
    please close this issue if you think that my explanation is reasonable

  5. lhotari commented on Nov 8, 2021

    @lhotari
    MemberAuthor

    Closed this issue, since it wasn't a problem with the lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/functiontype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions