Issue 12645: Pulsar Functions: detect .nar files and prevent spammy logs on functions boot [branch-2.7] #12665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Master Issue: #12645
Motivation
When Pulsar loads .jar file, it tries to unpack it a .nar and then it prints out the stack trace in #12645, that is very misleading.
Modifications
Detect the fact that we are going to load a .nar file, and do not try to unpack it if it is clear that it is not a .nar file.
We are going to preserve partially the previous behaviour and in case of FileNotFound we fallback to loading the file as .jar file as before.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
Documentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
no-need-doc
It is a small enhancement in logging