[ 
https://issues.apache.org/jira/browse/NIFI-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708455#comment-14708455
 ] 

Mark Payne commented on NIFI-842:
---------------------------------

[~bende] With the patch supplied, I can definitely see the concern that you are 
raising about restarting after some period of time. I think with the patch 
as-is, if we have the following scenario: NiFi runs for a few hours, dies; NiFi 
runs for a few hours, dies. Then we bootstrap would then detect this and exit, 
correct? I don't think that's the behavior we want. One of the main goals of 
the bootstrap module is specifically to ensure that in cases like this, it does 
restart NiFi. If an OutOfMemoryError, for instance, causes NiFi to die, the 
bootstrap should detect this and restart.

The only time that the bootstrap should not restart is when something happens 
that prevents NiFi from starting at all. I think one way to approach this is to 
modify the org.apache.nifi.NiFi class (in the 
nifi-framework-bundle/nifi-framework/nifi-runtime module). After it calls 
nifiServer.start() on line 137, it could create a connection to the bootstrap 
module (see BootstrapListener.start() for an example) and tell the bootstrap 
class that startup was successful.

This way, if the bootstrap is notified that startup was successful, and then 
NiFi does, it should restart NiFi. If it never was told that startup was 
successful, and it notices that NiFi has died, then it can stop running as well.

> If Bootstrap is unable to start NiFi, the process just stays around, 
> listening for connections
> ----------------------------------------------------------------------------------------------
>
>                 Key: NIFI-842
>                 URL: https://issues.apache.org/jira/browse/NIFI-842
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Bryan Bende
>             Fix For: 0.3.0
>
>         Attachments: NIFI-842.patch
>
>
> When the bootstrap launches NiFi, it should allow some amount of time 
> (perhaps a minute?) waiting to hear from NiFi. If it never hears, then it 
> should assume that the app was unable to start at all. In this case, 
> attempting to start it again is not going to be very helpful, so the 
> bootstrap should just exit



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to