You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2023/08/23 05:55:15 UTC
[spark] branch branch-3.4 updated: [SPARK-44920][CORE] Use await() instead of awaitUninterruptibly() in TransportClientFactory.createClient()
This is an automated email from the ASF dual-hosted git repository.
yao pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.4 by this push:
new 7a3b9500f2f [SPARK-44920][CORE] Use await() instead of awaitUninterruptibly() in TransportClientFactory.createClient()
7a3b9500f2f is described below
commit 7a3b9500f2ff6778ec2fc1219c5ffef3da8938fa
Author: Josh Rosen <jo...@databricks.com>
AuthorDate: Wed Aug 23 13:54:21 2023 +0800
[SPARK-44920][CORE] Use await() instead of awaitUninterruptibly() in TransportClientFactory.createClient()
### What changes were proposed in this pull request?
https://github.com/apache/spark/pull/41785 / SPARK-44241 introduced a new `awaitUninterruptibly()` call in one branch of `TrasportClientFactory.createClient()` (executed when the connection create timeout is non-positive). This PR replaces that call with an interruptible `await()` call.
Note that the other pre-existing branches in this method were already using `await()`.
### Why are the changes needed?
Uninterruptible waiting can cause problems when cancelling tasks. For details, see https://github.com/apache/spark/pull/16866 / SPARK-19529, an older PR fixing a similar issue in this same `TransportClientFactory.createClient()` method.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #42619 from JoshRosen/remove-awaitUninterruptibly.
Authored-by: Josh Rosen <jo...@databricks.com>
Signed-off-by: Kent Yao <ya...@apache.org>
(cherry picked from commit 2137606a6686b33bed57800c6b166059b134a089)
Signed-off-by: Kent Yao <ya...@apache.org>
---
.../java/org/apache/spark/network/client/TransportClientFactory.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java
index 3df72e65c2a..4c1efd69206 100644
--- a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java
+++ b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java
@@ -279,7 +279,7 @@ public class TransportClientFactory implements Closeable {
ChannelFuture cf = bootstrap.connect(address);
if (connCreateTimeout <= 0) {
- cf.awaitUninterruptibly();
+ cf.await();
assert cf.isDone();
if (cf.isCancelled()) {
throw new IOException(String.format("Connecting to %s cancelled", address));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org