Skip to content

Conversation

@rednaxelafx
Copy link
Contributor

@rednaxelafx rednaxelafx commented May 24, 2017

What changes were proposed in this pull request?

A one-liner change in ShuffleExchange.nodeName to cover the case when coordinator is null, so that the match expression is exhaustive.

Please refer to SPARK-20872 for a description of the symptoms.
TL;DR is that inspecting a ShuffleExchange (directly or transitively) on the Executor side can hit a case where the coordinator field of a ShuffleExchange is null, and thus will trigger a MatchError in ShuffleExchange.nodeName()'s inexhaustive match expression.

Also changed two other match conditions in ShuffleExchange on the coordinator field to be consistent.

How was this patch tested?

Manually tested this change with a case where the coordinator is null to make sure ShuffleExchange.nodeName doesn't throw a MatchError any more.

Copy link
Member

Choose a reason for hiding this comment

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

should we adjust this pattern match condition at other places in the class below as well?

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 had left the other match conditions unchanged so that this change itself can be small and contained, because I'd need to verify whether or not the other match conditions should only be invoked with some valid Option[ExchangeCoordinator] value.

Anyway, I checked the two other coordinator match { ... } cases below, and both of them should still work fine to change to match on _ instead of None. But semantically both of these cases should only be invoked on the Driver side, where the coordinator shouldn't be null. I'm okay to change these two cases if reviewers suggest so.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do it then, that will enable future readers easier to understand the code.

@jiangxb1987
Copy link
Contributor

LGTM, and I think it would be great if you can also address Sameer's comment.

@jiangxb1987
Copy link
Contributor

Also cc @gatorsmile

@rednaxelafx rednaxelafx force-pushed the shuffleexchange-nodename branch from 23aff2a to a65ac4f Compare May 24, 2017 20:56
@rednaxelafx
Copy link
Contributor Author

Updated patch to address the comments on making two other match conditions on coordinator so that they're consistently handled.

@SparkQA
Copy link

SparkQA commented May 24, 2017

Test build #77307 has finished for PR 18095 at commit 23aff2a.

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


// NOTE: coordinator can be null after serialization/deserialization,
// e.g. it can be null on the Executor side

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove this empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This note is meant to be a class internal comment, and not a comment on override lazy val metrics = Map(, so I'd say leaving the added empty line here makes more sense. Would you agree?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

@sameeragarwal
Copy link
Member

Thanks, LGTM too

@SparkQA
Copy link

SparkQA commented May 24, 2017

Test build #77309 has finished for PR 18095 at commit a65ac4f.

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

asfgit pushed a commit that referenced this pull request May 25, 2017
…nator

## What changes were proposed in this pull request?

A one-liner change in `ShuffleExchange.nodeName` to cover the case when `coordinator` is `null`, so that the match expression is exhaustive.

Please refer to [SPARK-20872](https://issues.apache.org/jira/browse/SPARK-20872) for a description of the symptoms.
TL;DR is that inspecting a `ShuffleExchange` (directly or transitively) on the Executor side can hit a case where the `coordinator` field of a `ShuffleExchange` is null, and thus will trigger a `MatchError` in `ShuffleExchange.nodeName()`'s inexhaustive match expression.

Also changed two other match conditions in `ShuffleExchange` on the `coordinator` field to be consistent.

## How was this patch tested?

Manually tested this change with a case where the `coordinator` is null to make sure `ShuffleExchange.nodeName` doesn't throw a `MatchError` any more.

Author: Kris Mok <kris.mok@databricks.com>

Closes #18095 from rednaxelafx/shuffleexchange-nodename.

(cherry picked from commit c0b3e45)
Signed-off-by: Xiao Li <gatorsmile@gmail.com>
@gatorsmile
Copy link
Member

Thanks! Merging to master/2.2

@asfgit asfgit closed this in c0b3e45 May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants