[ 
https://issues.apache.org/jira/browse/SPARK-53149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yang Jie reassigned SPARK-53149:
--------------------------------

    Assignee: Cheng Pan

> Fix testing whether BeeLine process run in background
> -----------------------------------------------------
>
>                 Key: SPARK-53149
>                 URL: https://issues.apache.org/jira/browse/SPARK-53149
>             Project: Spark
>          Issue Type: Bug
>          Components: Windows
>    Affects Versions: 3.5.6, 4.0.0
>            Reporter: Phil Walker
>            Assignee: Cheng Pan
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.1.0, 4.0.2, 3.5.8
>
>
> script `bin/load-spark-env.sh` tests for whether running in foreground or 
> background by calling `ps -o stat=` and checking output for `+`.    When 
> running in a windows shell environment, this results in an error message to 
> `stdout`.   This is because the `ps.exe` tool in these environments doesn't 
> support the `ps -o stat= -p $$` expression.
>  
> AFAIK, there is no equivalent expression in any of these environments (MSYS2, 
> cygwin64, Git-for-Windows).   However, the error message can be suppressed by 
> redirecting `stderr` to /dev/null, reducing the negative impact.
>  
> Currently, the last section of `bin/load-spark-env.sh` looks like this:
> ```
> if [[ ( ! $(ps -o stat= -p $$) =~ "+" ) && ! ( -p /dev/stdin ) ]]; then
>   export SPARK_BEELINE_OPTS="$SPARK_BEELINE_OPTS 
> -Djline.terminal=jline.UnsupportedTerminal"
> fi
> ```
> The following variation would eliminate the error message:
> ```
> if [[ ( ! $(ps -o stat= -p $$ 2>/dev/null) =~ "+" ) && ! ( -p /dev/stdin ) 
> ]]; then
>   export SPARK_BEELINE_OPTS="$SPARK_BEELINE_OPTS 
> -Djline.terminal=jline.UnsupportedTerminal"
> fi
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to