-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-6980] [CORE] Akka timeout exceptions indicate which conf controls them (RPC Layer) #6205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
97523e0
78a2c0a
5b59a44
49f9f04
23d2f26
a294569
f74064d
0ee5642
4be3a8d
b7fb99f
c07d05c
235919b
2f94095
1607a5f
4351c48
7774d56
995d196
d3754d1
08f5afc
1b9beab
2206b4d
1517721
1394de6
c6cfd33
b05d449
fa6ed82
fadaf6f
218aa50
039afed
be11c4e
7636189
3a168c7
3d8b1ff
287059a
7f4d78e
6a1c50d
4e89c75
dbd5f73
7bb70f1
06afa53
46c8d48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,8 +188,8 @@ private[spark] object RpcAddress { | |
|
|
||
|
|
||
| /** | ||
| * Associates a timeout with a configuration property so that a TimeoutException can be | ||
| * traced back to the controlling property. | ||
| * Associates a timeout with a description so that a when a TimeoutException occurs, additional | ||
| * context about the timeout can be amended to the exception message. | ||
| * @param timeout timeout duration in seconds | ||
| * @param description description to be displayed in a timeout exception | ||
| */ | ||
|
|
@@ -212,14 +212,16 @@ private[spark] class RpcTimeout(timeout: FiniteDuration, description: String) { | |
| Await.result(future, duration) | ||
| } | ||
| catch { | ||
| case te: TimeoutException => | ||
| throw amend(te) | ||
| case te: TimeoutException => throw amend(te) | ||
| } | ||
| } | ||
|
|
||
| // TODO(bryanc) wrap Await.ready also | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Create an RpcTimeout using a configuration property that controls the timeout duration so when | ||
| * a TimeoutException is thrown, the property key will be indicated in the message. | ||
| */ | ||
| object RpcTimeout { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
|
||
| private[this] val messagePrefix = "This timeout is controlled by " | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of putting The reason I'm asking is because in the tests, where you directly construct an
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point about the message in the tests. Way back when I first made the unit test for I don't think this is the case anymore and maybe we should use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is related to whether or not we get the time as seconds or millis. I'm thinking that we still leave the diff --git a/core/src/main/scala/org/apache/spark/rpc/RpcEnv.scala b/core/src/main/scala/org/apache/spark/rpc/RpcEnv.scala
index 5149cf1..e0de397 100644
--- a/core/src/main/scala/org/apache/spark/rpc/RpcEnv.scala
+++ b/core/src/main/scala/org/apache/spark/rpc/RpcEnv.scala
@@ -197,19 +197,16 @@ private[rpc] class RpcTimeoutException(message: String, cause: TimeoutException)
* Associates a timeout with a description so that a when a TimeoutException occurs, additional
* context about the timeout can be amended to the exception message.
* @param timeout timeout duration in seconds
- * @param description description to be displayed in a timeout exception
+ * @param conf the configuration parameter that controls this timeout
*/
-private[spark] class RpcTimeout(timeout: FiniteDuration, description: String) {
+private[spark] class RpcTimeout(timeout: FiniteDuration, val conf: String) {
/** Get the timeout duration */
def duration: FiniteDuration = timeout
- /** Get the message associated with this timeout */
- def message: String = description
-
/** Amends the standard message of TimeoutException to include the description */
private def createRpcTimeoutException(te: TimeoutException): RpcTimeoutException = {
- new RpcTimeoutException(te.getMessage() + " " + description, te)
+ new RpcTimeoutException(te.getMessage() + ". This timeout is controlled by " + conf, te)
}(and corresponding changes to the I do kinda wish that the values were read w/
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in fact we could also mark the constructor as
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see what you're saying. I kept the Quick Scala question: would it be better to make the constructor use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
|
@@ -248,5 +250,4 @@ object RpcTimeout { | |
| val timeout = { conf.getTimeAsSeconds(timeoutProp, defaultValue) seconds } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as mentioned above, I don't think so -- lets stick w/ the current behavior of using |
||
| new RpcTimeout(timeout, messagePrefix + timeoutProp) | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment can be deleted, it doesn't really apply to
object RpcTimeout, really its for the individualapplymethods which you've already got good docs for.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done