Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-1676

Processor can be scheduled to start running while it is still in a 'STOPPING' state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 0.6.0
    • Core Framework
    • None

    Description

      After the refactoring of the Processor Lifecycle that happened in 0.6.0, a Processor can be told to start while it is still 'stopping'.

      StandardProcessorNode.verifyCanStart() has the following logic:

              if (this.getScheduledState() == ScheduledState.RUNNING) {
                  throw new IllegalStateException(this + " cannot be started because it is already running");
              }
      

      However, if the state is 'stopping', it also should not be able to start. This wasn't accounted for originally because there was no 'stopping' state. There was only RUNNING and STOPPED; if not RUNNING, it was assumed to be stopped. However, now that there is a STOPPING state, we should instead verify:

              if (this.getScheduledState() != ScheduledState.STOPPED) {
                  throw new IllegalStateException(this + " cannot be started because it is not completely stopped");
              }
      

      Attachments

        Activity

          People

            markap14 Mark Payne
            markap14 Mark Payne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: