Phil Walker created SPARK-53149:
-----------------------------------

             Summary: test of background produces error message
                 Key: SPARK-53149
                 URL: https://issues.apache.org/jira/browse/SPARK-53149
             Project: Spark
          Issue Type: Bug
          Components: Windows
    Affects Versions: 4.0.0, 3.5.6
            Reporter: Phil Walker


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