This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new 149ef61e7fff [SPARK-54034][CORE] Fix `Utils.isBindCollision` to detect 
port conflict `NativeIoException` correctly
149ef61e7fff is described below

commit 149ef61e7fff393db4572510b200f298c61e9c99
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Sun Oct 26 17:54:51 2025 -0700

    [SPARK-54034][CORE] Fix `Utils.isBindCollision` to detect port conflict 
`NativeIoException` correctly
    
    This PR aims to fix `Utils.isBindCollision` to detect port conflict 
NativeIoException correctly by using regular expression.
    
    Currently, `Utils.isBindCollision` fails to detect port conflicts when we 
use native Netty transport IO modes, `EPOLL` and `KQUEUE`.
    
    **BEFORE**
    
    ```
    [info] AutoNettyRpcEnvSuite:
    [info] - port conflict *** FAILED *** (7 milliseconds)
    [info]   io.netty.channel.unix.Errors$NativeIoException: bind(..) failed 
with error(-48): Address already in use
    ```
    
    **AFTER**
    
    ```
    [info] AutoNettyRpcEnvSuite:
    [info] - port conflict (68 milliseconds)
    ```
    
    No, this is a bug fix.
    
    Pass the CI with the newly added test suite, `AutoNettyRpcEnvSuite`.
    
    No.
    
    Closes #52738 from dongjoon-hyun/SPARK-54034.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
    (cherry picked from commit e2b107196f593e268b9bd5ba5a4f03f6e658dd28)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 core/src/main/scala/org/apache/spark/util/Utils.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala 
b/core/src/main/scala/org/apache/spark/util/Utils.scala
index 3b0efffedec6..4e498e57d920 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -2304,7 +2304,7 @@ private[spark] object Utils
       case e: MultiException =>
         e.getThrowables.asScala.exists(isBindCollision)
       case e: NativeIoException =>
-        (e.getMessage != null && e.getMessage.startsWith("bind() failed: ")) ||
+        (e.getMessage != null && e.getMessage.matches("bind.*failed.*")) ||
           isBindCollision(e.getCause)
       case e: Exception => isBindCollision(e.getCause)
       case _ => false


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

Reply via email to