Skip to content

Conversation

@holdenk
Copy link
Contributor

@holdenk holdenk commented Jan 6, 2021

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.

@holdenk
Copy link
Contributor Author

holdenk commented Jan 6, 2021

cc @dongjoon-hyun

@SparkQA
Copy link

SparkQA commented Jan 6, 2021

Test build #133756 has finished for PR 31071 at commit 68a902f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 6, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38344/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation?

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, got it.

Copy link
Member

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)
}

Copy link
Contributor Author

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?

Copy link
Member

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. :)

Copy link
Contributor Author

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?

@SparkQA
Copy link

SparkQA commented Jan 6, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38344/

@holdenk holdenk changed the title [SPARK-34018][K8S]finishedExecutorWithRunningSidecar depends on nulls matching [SPARK-34018][K8S] NPE in ExecutorPodsSnapshot Jan 7, 2021
@holdenk
Copy link
Contributor Author

holdenk commented Jan 7, 2021 via email

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Test build #133804 has started for PR 31071 at commit c936501.

@holdenk holdenk force-pushed the SPARK-34018-finishedExecutorWithRunningSidecar-doesnt-correctly-constructt-the-test-case branch from c936501 to 776d15f Compare January 7, 2021 21:21
…state string. To fix this label both the statuses and ensure the ExecutorPodSnapshot starts with the default config to match.
@holdenk holdenk force-pushed the SPARK-34018-finishedExecutorWithRunningSidecar-doesnt-correctly-constructt-the-test-case branch from 776d15f to 98ed3e8 Compare January 7, 2021 21:24
@dongjoon-hyun
Copy link
Member

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Test build #133810 has finished for PR 31071 at commit 86b09a6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38399/

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38399/

@holdenk
Copy link
Contributor Author

holdenk commented Jan 8, 2021

WDYT of the flatMap approach @dongjoon-hyun ?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

WDYT of the flatMap approach @dongjoon-hyun ?

The new approach looks nice! @holdenk

dongjoon-hyun pushed a commit that referenced this pull request Jan 8, 2021
### 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants