Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 93702200C2A for ; Tue, 14 Feb 2017 23:23:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 92040160B45; Tue, 14 Feb 2017 22:23:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E09D4160B6A for ; Tue, 14 Feb 2017 23:23:48 +0100 (CET) Received: (qmail 16259 invoked by uid 500); 14 Feb 2017 22:23:48 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 16174 invoked by uid 99); 14 Feb 2017 22:23:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2017 22:23:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 961CCC0D33 for ; Tue, 14 Feb 2017 22:23:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.998 X-Spam-Level: X-Spam-Status: No, score=-1.998 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id V30BPSvj44jf for ; Tue, 14 Feb 2017 22:23:46 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 1F3935FAE6 for ; Tue, 14 Feb 2017 22:23:46 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2454EE0798 for ; Tue, 14 Feb 2017 22:23:44 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 9265524129 for ; Tue, 14 Feb 2017 22:23:42 +0000 (UTC) Date: Tue, 14 Feb 2017 22:23:42 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@nifi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NIFI-1856) ExecuteStreamCommand Needs to Consume Standard Error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 14 Feb 2017 22:23:49 -0000 [ https://issues.apache.org/jira/browse/NIFI-1856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866827#comment-15866827 ] ASF GitHub Bot commented on NIFI-1856: -------------------------------------- Github user brosander commented on the issue: https://github.com/apache/nifi/pull/1364 Reviewing > ExecuteStreamCommand Needs to Consume Standard Error > ---------------------------------------------------- > > Key: NIFI-1856 > URL: https://issues.apache.org/jira/browse/NIFI-1856 > Project: Apache NiFi > Issue Type: Bug > Reporter: Alan Jackoway > Assignee: Karthik Narayanan > > I was using ExecuteStreamProcess to run certain hdfs commands that are tricky to write in nifi but easy in bash (e.g. {{hadoop fs -rm -r /data/*/2014/05/05}}) > However, my larger commands kept hanging even though when I run them from the command line they finish quickly. > Based on http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html I believe that ExecuteStreamCommand and possibly other processors need to consume the standard error stream to prevent the processes from blocking when standard error gets filled. > To reproduce. Create this as ~/write.py > {code:python} > import sys > count = int(sys.argv[1]) > for x in range(count): > sys.stderr.write("ERROR %d\n" % x) > sys.stdout.write("OUTPUT %d\n" % x) > {code} > Create a flow that goes > # GenerateFlowFile - 5 minutes schedule 0 bytes size > # ExecuteStreamCommand - Command arguments /Users/alanj/write.py;100 Command Path python > # PutFile - /tmp/write/ > routing output stream of ExecuteStreamCommand to PutFile > When you turn everything on, you get 100 lines (not 200) of just the standard output in /tmp/write. > Next, change the command arguments to /Users/alanj/write.py;100000 and turn everything on again. The command will hang. > I believe that whenever you execute a process the way ExecuteStreamCommand is doing, you need to consume the standard error stream to keep it from blocking. This may also affect things like ExecuteProcess and ExecuteScript as well. -- This message was sent by Atlassian JIRA (v6.3.15#6346)