You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by michalklempa <gi...@git.apache.org> on 2016/10/04 12:26:55 UTC

[GitHub] nifi pull request #1093: Fixes NIFI-1069 init script status exit code 3 when...

GitHub user michalklempa opened a pull request:

    https://github.com/apache/nifi/pull/1093

    Fixes NIFI-1069 init script status exit code 3 when not running

    Fixes NIFI-1069 init script status exit code 3 when not running , 0 when running

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/michalklempa/nifi NIFI-1069_fix_init_status_exit_code

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1093.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1093
    
----
commit 460da679ed66e6d7ba1c93b06d5660f2d7a0a70b
Author: Michal Klempa <mi...@gmail.com>
Date:   2016-10-04T12:25:49Z

    Fixes NIFI-1069 init script status exit code 3 when not running, 0 when running

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1093: Fixes NIFI-1069 init script status exit code 3 when...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1093#discussion_r83360074
  
    --- Diff: nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java ---
    @@ -581,30 +585,31 @@ private Status getStatus(final Logger logger) {
             return new Status(port, pid, pingSuccess, alive);
         }
     
    -    public void status() throws IOException {
    +    public int status() throws IOException {
             final Logger logger = cmdLogger;
             final Status status = getStatus(logger);
             if (status.isRespondingToPing()) {
                 logger.info("Apache NiFi is currently running, listening to Bootstrap on port {}, PID={}",
                         new Object[]{status.getPort(), status.getPid() == null ? "unknown" : status.getPid()});
    -            return;
    +            return 0;
             }
     
             if (status.isProcessRunning()) {
                 logger.info("Apache NiFi is running at PID {} but is not responding to ping requests", status.getPid());
    -            return;
    +            return 0;
    --- End diff --
    
    @michalklempa It could be said the kernel PID refers to the JVM and not to the enclosed program. In this case, a rather return 4 as this stage, as the system is not in a healthy state and a certain status cannot be derived.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1093: Fixes NIFI-1069 init script status exit code 3 when...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1093#discussion_r82104883
  
    --- Diff: nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java ---
    @@ -581,30 +585,31 @@ private Status getStatus(final Logger logger) {
             return new Status(port, pid, pingSuccess, alive);
         }
     
    -    public void status() throws IOException {
    +    public int status() throws IOException {
             final Logger logger = cmdLogger;
             final Status status = getStatus(logger);
             if (status.isRespondingToPing()) {
                 logger.info("Apache NiFi is currently running, listening to Bootstrap on port {}, PID={}",
                         new Object[]{status.getPort(), status.getPid() == null ? "unknown" : status.getPid()});
    -            return;
    +            return 0;
             }
     
             if (status.isProcessRunning()) {
                 logger.info("Apache NiFi is running at PID {} but is not responding to ping requests", status.getPid());
    -            return;
    +            return 0;
    --- End diff --
    
    Should this 0? I would imagine returning 4 _"program or service status is unknown"_ would make more sense?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1093: Fixes NIFI-1069 init script status exit code 3 when...

Posted by michalklempa <gi...@git.apache.org>.
Github user michalklempa commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1093#discussion_r83710519
  
    --- Diff: nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java ---
    @@ -581,30 +585,31 @@ private Status getStatus(final Logger logger) {
             return new Status(port, pid, pingSuccess, alive);
         }
     
    -    public void status() throws IOException {
    +    public int status() throws IOException {
             final Logger logger = cmdLogger;
             final Status status = getStatus(logger);
             if (status.isRespondingToPing()) {
                 logger.info("Apache NiFi is currently running, listening to Bootstrap on port {}, PID={}",
                         new Object[]{status.getPort(), status.getPid() == null ? "unknown" : status.getPid()});
    -            return;
    +            return 0;
             }
     
             if (status.isProcessRunning()) {
                 logger.info("Apache NiFi is running at PID {} but is not responding to ping requests", status.getPid());
    -            return;
    +            return 0;
    --- End diff --
    
    resolved.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1093: Fixes NIFI-1069 init script status exit code 3 when not ru...

Posted by JPercivall <gi...@git.apache.org>.
Github user JPercivall commented on the issue:

    https://github.com/apache/nifi/pull/1093
  
    @michalklempa @trixpan I believe this commit broke "restart" functionality of nifi.sh. I tried it on the previous commit on master[1] and it works but when I tested this commit it failed. It stops the instance but doesn't initiate a restart.
    
    [1] https://github.com/apache/nifi/commit/231f5143ab8100d6a5d4543a5476694378fdcf6d


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1093: Fixes NIFI-1069 init script status exit code 3 when not ru...

Posted by michalklempa <gi...@git.apache.org>.
Github user michalklempa commented on the issue:

    https://github.com/apache/nifi/pull/1093
  
    @JPercivall Oh my god. Thank you Joe for figuring this out. The problem is apparently on line https://github.com/apache/nifi/commit/99d3c397481a98a5b3d2d4e44b84516fc0e3675e#diff-0242d48c1b4267348183977fd0cf8966R305
    where I immediately exit the script with proper exit status. This works for stop and start, but since restart action calls the 'run' function twice, the exit directive only does 'stopping' and immediately exits.
    
    I will fix this later today and push to a new Pull Request as this change had already been merged. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1093: Fixes NIFI-1069 init script status exit code 3 when not ru...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on the issue:

    https://github.com/apache/nifi/pull/1093
  
    @michalklempa - thank you for the contribution. 
    
    This has now been merged. We hope to see further contributions from you in the future.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1093: Fixes NIFI-1069 init script status exit code 3 when...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1093#discussion_r83521841
  
    --- Diff: nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java ---
    @@ -581,30 +585,31 @@ private Status getStatus(final Logger logger) {
             return new Status(port, pid, pingSuccess, alive);
         }
     
    -    public void status() throws IOException {
    +    public int status() throws IOException {
             final Logger logger = cmdLogger;
             final Status status = getStatus(logger);
             if (status.isRespondingToPing()) {
                 logger.info("Apache NiFi is currently running, listening to Bootstrap on port {}, PID={}",
                         new Object[]{status.getPort(), status.getPid() == null ? "unknown" : status.getPid()});
    -            return;
    +            return 0;
             }
     
             if (status.isProcessRunning()) {
                 logger.info("Apache NiFi is running at PID {} but is not responding to ping requests", status.getPid());
    -            return;
    +            return 0;
    --- End diff --
    
    @michalklempa 
    
    Bear with me while I defer this to the wider community. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1093: Fixes NIFI-1069 init script status exit code 3 when not ru...

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on the issue:

    https://github.com/apache/nifi/pull/1093
  
    @michalklempa thanks for getting this sorted. Will merge later today.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1093: Fixes NIFI-1069 init script status exit code 3 when not ru...

Posted by michalklempa <gi...@git.apache.org>.
Github user michalklempa commented on the issue:

    https://github.com/apache/nifi/pull/1093
  
    New pull request: https://github.com/apache/nifi/pull/1159


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1093: Fixes NIFI-1069 init script status exit code 3 when...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1093


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---