[
https://issues.apache.org/jira/browse/NIFI-1905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293325#comment-15293325
]
ASF GitHub Bot commented on NIFI-1905:
--------------------------------------
GitHub user olegz opened a pull request:
https://github.com/apache/nifi/pull/456
NIFI-1905 enabled ExecuteProcess to terminate process
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/olegz/nifi NIFI-1905
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/456.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 #456
----
commit 7924933b892d3f6b59741389b53ca50c7781e728
Author: Oleg Zhurakousky <[email protected]>
Date: 2016-05-20T13:05:44Z
NIFI-1905 enabled ExecuteProcess to terminate process
----
> Stop action doesn't invoke ExecuteProcess.destroy()
> ---------------------------------------------------
>
> Key: NIFI-1905
> URL: https://issues.apache.org/jira/browse/NIFI-1905
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 0.6.1
> Environment: 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)
> Reporter: Andrew Grande
> Assignee: Oleg Zhurakousky
> Priority: Critical
> Fix For: 1.0.0, 0.7.0
>
> Attachments: NIFI-1905.xml
>
>
> 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.
> {code}
> 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)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)