-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-10001] Consolidate Signaling and SignalLogger. #12605
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
Conversation
|
cc @jodersky |
| } | ||
|
|
||
| if(escalate) { | ||
| val escalate = actions.asScala.forall { action => !action() } |
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.
can you write a short description here on what this is doing? it's not very straightforward (especially the forall and boolean inversion)
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.
sure, I initially had comments but thought they were overkill since the behaviour can be deducted from the comments in the register() method. I'll add some more info
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.
how should I add the comments? Just post them here and you'll update the PR?
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.
sounds good
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.
/**
* Called when this handler's signal is received. Note that if the same signal is received
* before this method returns, it is escalated to the previous handler.
*/
override def handle(sig: Signal): Unit = {
// register old handler, will receive incoming signals while this handler is running
Signal.handle(signal, prevHandler)
// run all actions, escalate to parent handler if no action says the signal was caught
// (i.e. all actions return false)
val escalate = actions.asScala.forall { action => !action() }
if (escalate) {
prevHandler.handle(sig)
}
// re-register this handler
Signal.handle(signal, this)
}is this better? I can add even more if you prefer
|
OK updated. |
|
Test build #56673 has finished for PR 12605 at commit
|
|
Test build #56682 has finished for PR 12605 at commit
|
|
Merging in master. |
What changes were proposed in this pull request?
This is a follow-up to #12557, with the following changes:
How was this patch tested?
N/A.