beliefer commented on a change in pull request #26510: 
[SPARK-29885][PYTHON][CORE] Improve the exception message when reading the 
daemon port
URL: https://github.com/apache/spark/pull/26510#discussion_r347702132
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala
 ##########
 @@ -213,7 +213,14 @@ private[spark] class PythonWorkerFactory(pythonExec: 
String, envVars: Map[String
           daemonPort = in.readInt()
         } catch {
           case _: EOFException =>
-            throw new SparkException(s"No port number in $daemonModule's 
stdout")
+            val exceptionMessage =
 
 Review comment:
   @jiangxb1987 Thanks for your review. But the `DataInputStream` just throws 
`EOFException` without any detail. The implement of readInt as follows:
   ```
       public final int readInt() throws IOException {
           int ch1 = in.read();
           int ch2 = in.read();
           int ch3 = in.read();
           int ch4 = in.read();
           if ((ch1 | ch2 | ch3 | ch4) < 0)
               throw new EOFException();
           return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to