[jira] [Commented] (AIRFLOW-1479) BashOperator does not open pipe for STDIN

2017-08-01 Thread Cedrik Neumann (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRFLOW-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16109063#comment-16109063
 ] 

Cedrik Neumann commented on AIRFLOW-1479:
-

Yeah, we were puzzled quite some time back then until we found the culprit. At 
Wooga we're running a version with the {{PIPE}} fix for some time already.
But you're right, {{DEVNULL}} might make more sense. We can try that out in our 
version and then open a PR accordingly.

> BashOperator does not open pipe for STDIN
> -
>
> Key: AIRFLOW-1479
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1479
> Project: Apache Airflow
>  Issue Type: Bug
>  Components: operators
>Affects Versions: 1.8.1
> Environment: FreeBSD, JRuby 9.x, Rake, Python 2.7, Airflow 1.8
>Reporter: Cedrik Neumann
>Priority: Trivial
>  Labels: easyfix
>
> From JRuby 9 onwards we experienced issues when executing Rake tasks via the 
> BashOperator with the error message:
> {noformat}
> Errno::EBADF: Bad file descriptor - 0
> {noformat}
> We figured out that the issue is due to a missing pipe for STDIN when the 
> BashOperator calls `Popen`.
> The quick fix of the issue would be to add a pipe for STDIN as well:
> {code:python}
> sp = Popen(
> ['bash', fname],
> stdout=PIPE, stderr=STDOUT, stdin=PIPE,
> cwd=tmp_dir, env=self.env)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (AIRFLOW-1479) BashOperator does not open pipe for STDIN

2017-08-01 Thread Ash Berlin-Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRFLOW-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16109053#comment-16109053
 ] 

Ash Berlin-Taylor commented on AIRFLOW-1479:


Oh. {{DEVNULL}} is only a Py3 thing. The portable equivalent is:

{noformat}
FNULL = open(os.devnull, 'r')
retcode = subprocess.call(['echo', 'foo'], stdin=FNULL, )
{noformat}


> BashOperator does not open pipe for STDIN
> -
>
> Key: AIRFLOW-1479
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1479
> Project: Apache Airflow
>  Issue Type: Bug
>  Components: operators
>Affects Versions: 1.8.1
> Environment: FreeBSD, JRuby 9.x, Rake, Python 2.7, Airflow 1.8
>Reporter: Cedrik Neumann
>Priority: Trivial
>  Labels: easyfix
>
> From JRuby 9 onwards we experienced issues when executing Rake tasks via the 
> BashOperator with the error message:
> {noformat}
> Errno::EBADF: Bad file descriptor - 0
> {noformat}
> We figured out that the issue is due to a missing pipe for STDIN when the 
> BashOperator calls `Popen`.
> The quick fix of the issue would be to add a pipe for STDIN as well:
> {code:python}
> sp = Popen(
> ['bash', fname],
> stdout=PIPE, stderr=STDOUT, stdin=PIPE,
> cwd=tmp_dir, env=self.env)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (AIRFLOW-1479) BashOperator does not open pipe for STDIN

2017-08-01 Thread Ash Berlin-Taylor (JIRA)

[ 
https://issues.apache.org/jira/browse/AIRFLOW-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16109050#comment-16109050
 ] 

Ash Berlin-Taylor commented on AIRFLOW-1479:


{{PIPE}} seems like the wrong choice for stdin as we won't be feeding any input 
to the subprocess. There is a special value {{DEVNULL}} that seems more 
apropriate for stdin.

(We are not currently passing any value which means the child inherits stdin 
from the parent process. I'm not sure what it's connected to but a bit 
surprised to see if giving EBADF)

> BashOperator does not open pipe for STDIN
> -
>
> Key: AIRFLOW-1479
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1479
> Project: Apache Airflow
>  Issue Type: Bug
>  Components: operators
>Affects Versions: 1.8.1
> Environment: FreeBSD, JRuby 9.x, Rake, Python 2.7, Airflow 1.8
>Reporter: Cedrik Neumann
>Priority: Trivial
>  Labels: easyfix
>
> From JRuby 9 onwards we experienced issues when executing Rake tasks via the 
> BashOperator with the error message:
> {noformat}
> Errno::EBADF: Bad file descriptor - 0
> {noformat}
> We figured out that the issue is due to a missing pipe for STDIN when the 
> BashOperator calls `Popen`.
> The quick fix of the issue would be to add a pipe for STDIN as well:
> {code:python}
> sp = Popen(
> ['bash', fname],
> stdout=PIPE, stderr=STDOUT, stdin=PIPE,
> cwd=tmp_dir, env=self.env)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)