Skip to content
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

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

Closed
lhotari opened this issue Nov 5, 2021 · 3 comments
Labels
area/function type/bug The PR fixed a bug or issue reported a bug
Milestone

Comments

@lhotari
Copy link
Member

lhotari commented Nov 5, 2021

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:?]
@eolivelli
Copy link
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

@eolivelli
Copy link
Contributor

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

@lhotari lhotari closed this as completed Nov 8, 2021
@lhotari
Copy link
Member Author

lhotari commented Nov 8, 2021

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
Labels
area/function type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

2 participants