-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-34018][K8S] NPE in ExecutorPodsSnapshot #31071
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
[SPARK-34018][K8S] NPE in ExecutorPodsSnapshot #31071
Conversation
|
Test build #133756 has finished for PR 31071 at commit
|
|
Kubernetes integration test starting |
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.
Indentation?
...rnetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala
Outdated
Show resolved
Hide resolved
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.
If we have three case statements before this line, t is null and t is not null and exit code is non-zero and t is not null and exist code is zero` is covered. When we fall into here?
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.
We shouldn't but this is to prevent the spurious "non-exhaustive match" warning.
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.
Oh, got it.
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.
What about the following?
sparkContainerStatus.getState.getTerminated match {
case t if t != null and t.getExitCode != 0 =>
PodFailed(pod)
case t if t != null and t.getExitCode == 0 =>
PodSucceeded(pod)
case _ =>
PodRunning(pod)
}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 that would work to. Do you prefer this one?
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.
Yes, I do because it's shorter. :)
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 refactored this into using flatMaps so we can just pattern match on the result, WDYT?
|
Kubernetes integration test status success |
|
Sounds good, I’ll change it over.
On Wed, Jan 6, 2021 at 9:19 PM Dongjoon Hyun ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala
<#31071 (comment)>:
> case t if t.getExitCode != 0 =>
PodFailed(pod)
case t if t.getExitCode == 0 =>
PodSucceeded(pod)
+ // Fall through case
case _ =>
PodRunning(pod)
}
Yes, I do because it's shorter. :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31071 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOT5PLDXUFED5M34LOVTLSYU75XANCNFSM4VX7W6RA>
.
--
Cell : 425-233-8271
|
|
Test build #133804 has started for PR 31071 at commit |
c936501 to
776d15f
Compare
…state string. To fix this label both the statuses and ensure the ExecutorPodSnapshot starts with the default config to match.
776d15f to
98ed3e8
Compare
|
Please don't forget https://github.com/apache/spark/pull/31071/files#r552961918 . |
|
Test build #133810 has finished for PR 31071 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
WDYT of the flatMap approach @dongjoon-hyun ? |
dongjoon-hyun
left a comment
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.
### What changes were proposed in this pull request? Label both the statuses and ensure the ExecutorPodSnapshot starts with the default config to match. ### Why are the changes needed? The current test depends on the order rather than testing the desired property. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Labeled the containers statuses, observed failures, added the default label as the initialization point, tests passed again. Built Spark, ran on K8s cluster verified no NPE in driver log. Closes #31071 from holdenk/SPARK-34018-finishedExecutorWithRunningSidecar-doesnt-correctly-constructt-the-test-case. Authored-by: Holden Karau <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 8e11ce5) Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
Label both the statuses and ensure the ExecutorPodSnapshot starts with the default config to match.
Why are the changes needed?
The current test depends on the order rather than testing the desired property.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Labeled the containers statuses, observed failures, added the default label as the initialization point, tests passed again.
Built Spark, ran on K8s cluster verified no NPE in driver log.