Skip to content

Commit 3a3f710

Browse files
zsxwingrxin
authored andcommitted
[SPARK-6490][Docs] Add docs for rpc configurations
Added docs for rpc configurations and also fixed two places that should have been fixed in #5595. Author: zsxwing <[email protected]> Closes #5607 from zsxwing/SPARK-6490-docs and squashes the following commits: 25a6736 [zsxwing] Increase the default timeout to 120s 6e37c30 [zsxwing] Update docs 5577540 [zsxwing] Use spark.network.timeout as the default timeout if it presents 4f07174 [zsxwing] Fix unit tests 1c2cf26 [zsxwing] Add docs for rpc configurations
1 parent a0761ec commit 3a3f710

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

core/src/main/scala/org/apache/spark/util/RpcUtils.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ object RpcUtils {
4848

4949
/** Returns the default Spark timeout to use for RPC ask operations. */
5050
def askTimeout(conf: SparkConf): FiniteDuration = {
51-
conf.getTimeAsSeconds("spark.rpc.askTimeout", "30s") seconds
51+
conf.getTimeAsSeconds("spark.rpc.askTimeout",
52+
conf.get("spark.network.timeout", "120s")) seconds
5253
}
5354

5455
/** Returns the default Spark timeout to use for RPC remote endpoint lookup. */
5556
def lookupTimeout(conf: SparkConf): FiniteDuration = {
56-
conf.getTimeAsSeconds("spark.rpc.lookupTimeout", "30s") seconds
57+
conf.getTimeAsSeconds("spark.rpc.lookupTimeout",
58+
conf.get("spark.network.timeout", "120s")) seconds
5759
}
5860
}

core/src/test/scala/org/apache/spark/SparkConfSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class SparkConfSuite extends FunSuite with LocalSparkContext with ResetSystemPro
227227
test("akka deprecated configs") {
228228
val conf = new SparkConf()
229229

230-
assert(!conf.contains("spark.rpc.num.retries"))
230+
assert(!conf.contains("spark.rpc.numRetries"))
231231
assert(!conf.contains("spark.rpc.retry.wait"))
232232
assert(!conf.contains("spark.rpc.askTimeout"))
233233
assert(!conf.contains("spark.rpc.lookupTimeout"))

core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ abstract class RpcEnvSuite extends FunSuite with BeforeAndAfterAll {
156156

157157
val conf = new SparkConf()
158158
conf.set("spark.rpc.retry.wait", "0")
159-
conf.set("spark.rpc.num.retries", "1")
159+
conf.set("spark.rpc.numRetries", "1")
160160
val anotherEnv = createRpcEnv(conf, "remote", 13345)
161161
// Use anotherEnv to find out the RpcEndpointRef
162162
val rpcEndpointRef = anotherEnv.setupEndpointRef("local", env.address, "ask-timeout")

docs/configuration.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,9 @@ Apart from these, the following properties are also available, and may be useful
963963
<td>
964964
Default timeout for all network interactions. This config will be used in place of
965965
<code>spark.core.connection.ack.wait.timeout</code>, <code>spark.akka.timeout</code>,
966-
<code>spark.storage.blockManagerSlaveTimeoutMs</code> or
967-
<code>spark.shuffle.io.connectionTimeout</code>, if they are not configured.
966+
<code>spark.storage.blockManagerSlaveTimeoutMs</code>,
967+
<code>spark.shuffle.io.connectionTimeout</code>, <code>spark.rpc.askTimeout</code> or
968+
<code>spark.rpc.lookupTimeout</code> if they are not configured.
968969
</td>
969970
</tr>
970971
<tr>
@@ -982,6 +983,35 @@ Apart from these, the following properties are also available, and may be useful
982983
This is only relevant for the Spark shell.
983984
</td>
984985
</tr>
986+
<tr>
987+
<td><code>spark.rpc.numRetries</code></td>
988+
<td>3</td>
989+
Number of times to retry before an RPC task gives up.
990+
An RPC task will run at most times of this number.
991+
<td>
992+
</td>
993+
</tr>
994+
<tr>
995+
<td><code>spark.rpc.retry.wait</code></td>
996+
<td>3s</td>
997+
<td>
998+
Duration for an RPC ask operation to wait before retrying.
999+
</td>
1000+
</tr>
1001+
<tr>
1002+
<td><code>spark.rpc.askTimeout</code></td>
1003+
<td>120s</td>
1004+
<td>
1005+
Duration for an RPC ask operation to wait before timing out.
1006+
</td>
1007+
</tr>
1008+
<tr>
1009+
<td><code>spark.rpc.lookupTimeout</code></td>
1010+
<td>120s</td>
1011+
Duration for an RPC remote endpoint lookup operation to wait before timing out.
1012+
<td>
1013+
</td>
1014+
</tr>
9851015
</table>
9861016

9871017
#### Scheduling

0 commit comments

Comments
 (0)