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

Stop action doesn't invoke ExecuteProcess.destroy()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.6.1
    • 1.0.0, 0.7.0, 1.0.0-Beta
    • None
    • None
    • Raspberry Pi 3

      Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
      Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

    Description

      Consider the attached template. There is an ExecuteProcess which wraps a python script (listed below).

      STR:

      • start ListenTcp
      • start ExecuteProcess
      • stop ExecuteProcess

      Expected: the ExecuteProcess component terminates successfully
      Actual: there's always a thread running (1 displayed in the top-right corner of the processor)

      The thread will only go away if the underlying command crashes. It's easy to replicate by stopping ListenTcp - the script will fail with a socket connection error and quit.

      I have been looking into the ExecuteProcess source, and it looks like OnUnscheduled must also invoke Process.destroy() in addition to terminating the stdio/stderr I/O threads, but there's nothing like that anywhere.

      import serial
      import socket
      
      # set up the serial connection speed
      ser = serial.Serial('/dev/ttyUSB0', 115200)
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      s.connect(('localhost',3456))
      # main loop
      while 1:
          data = ser.readline()
          s.sendall(data)
      

      Attachments

        1. NIFI-1905.xml
          28 kB
          Andrew Grande

        Issue Links

          Activity

            People

              ozhurakousky Oleg Zhurakousky
              aperepel Andrew Grande
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: