This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 3e09fd24aa5a [SPARK-54034][CORE] Fix `Utils.isBindCollision` to detect
port conflict `NativeIoException` correctly
3e09fd24aa5a is described below
commit 3e09fd24aa5a1ddd0e94ba9d11056dc2ac4edfbe
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 7f86902573db..3d7cfdfd98b9 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -2313,7 +2313,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: IOException =>
(e.getMessage != null && e.getMessage.startsWith("Failed to bind to
address")) ||
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]