-
Notifications
You must be signed in to change notification settings - Fork 2.8k
NIFI-14458 - Added run command to nifi.cmd #9869
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing this change @philci52.
However, calling BootstrapProcess
with the start
command is different than the behavior of the nifi.sh
script. From that perspective, the behavior should be the same across both platforms.
If you aren't in a position to implement those details, I may be able to take a look at that approach.
I guess I don't understand the difference. Is it in the Java code? Will I still be able to run "nifi stop" to stop the application if run that way? |
Here's the section of As shown, it calls the BootstrapProcess class with Yes, |
Looks like there will be more issues with paths that have spaces (probably an issue on linux too). https://github.com/apache/nifi/blob/main/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/command/GetRunCommandBootstrapCommand.java#L78 |
@exceptionfactory Fixing the issue with the paths that have spaces in the GetRunCommandBootstrapCommand.java is a potentially breaking change. If I just surround all arguments with double quotes, while that works for me, it will break any users who have figured out that they need quotes in bootstrap.conf. I'm not sure how common this use case is. For example, if I have Additionally, another way to get around this on windows would have been to use the caret to escape the next character, for example, I could have used So, this leaves a few courses of action that I see
|
Thanks for the thoughtful evaluation of options @philci52. I think there are two different elements to consider. The first aspect is bootstrap.conf. Property values using
The second aspect is the standard arguments to the command, which include the following from
Arguments 1, 2, and 3 contain paths that may need to be quoted, so for those cases, quoting the value of the argument seems like the way to go. Arguments 4 and 6 do not need to be quoted. The additional arguments in 5 can be addressed as described above. With that background, it seems like making adjustments to |
@exceptionfactory Thank you for the quick feedback. There is one other path that may need to be quoted and that is the (7) path to java itself. With regards to using StandardProcessBuilderProvider, that class will have to know if its creating arguments for the shell/console or for using ProcessBuilder. When using ProcessBuilder, passing |
Good question @philci52, the I will take a closer look at this and follow up soon. One other potential path is to pass the |
Here is a comment from some of our internal code regarding the use of process builder and windows/linux differences. This application uses an XML file for configuration, but I figured it would be relevant to this conversation
So it appears that windows will remove the quote characters and linux will keep them. |
@exceptionfactory Any updates on how you want to handle the issues here? |
Thanks for checking @philci52, I evaluated some options last week using the existing run command, but didn't find a satisfactory solution. At the moment, evaluating the impact of selective quoting in the Are you in a position to implement and evaluate the approach for Windows, along with the impact on Linux platforms? If not, I may be able to take a closer look. |
I can work on this, but it will take me a few weeks to get back to it. |
Summary
NIFI-14458
Added run command to nifi.cmd to allow NiFi to run in the foreground and be used with Apache ProcRun
Tracking
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation