Skip to content

Comments

[SPARK-38461][CORE] Use error classes in org.apache.spark.broadcast#35960

Closed
bozhang2820 wants to merge 1 commit intoapache:masterfrom
bozhang2820:spark-38461
Closed

[SPARK-38461][CORE] Use error classes in org.apache.spark.broadcast#35960
bozhang2820 wants to merge 1 commit intoapache:masterfrom
bozhang2820:spark-38461

Conversation

@bozhang2820
Copy link
Contributor

What changes were proposed in this pull request?

This change is to refactor exceptions thrown in org.apache.spark.broadcast to use error class framework.

Why are the changes needed?

This is to follow the error class framework.

Does this PR introduce any user-facing change?

Yes. To aggregate the exceptions, there are minor changes in error messages in the exceptions thrown.

How was this patch tested?

Added unit tests.

@github-actions github-actions bot added the CORE label Mar 24, 2022
numCores: Int,
mockOutputCommitCoordinator: Option[OutputCommitCoordinator] = None): SparkEnv = {
mockOutputCommitCoordinator: Option[OutputCommitCoordinator] = None,
blockManagerOption: Option[BlockManager] = None): SparkEnv = {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
blockManagerOption: Option[BlockManager] = None): SparkEnv = {
mockOutputCommitCoordinator: Option[BlockManager] = None): SparkEnv = {

to follow mockOutputCommitCoordinator above? It is also more clear that this is used as mock one in test only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

Copy link
Contributor

@mridulm mridulm left a comment

Choose a reason for hiding this comment

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

Took a quick pass through the PR.

logError(s"Store broadcast $broadcastId fail, remove all pieces of the broadcast")
blockManager.removeBroadcast(id, tellMaster = true)
throw t
throw SparkCoreErrors.storeBlockError(broadcastId, t)
Copy link
Contributor

Choose a reason for hiding this comment

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

Two issues with this:
a) We are changing the exception being thrown (note: we are catching Throwable).
b) Message for exception thrown in L151 is getting changed in L160.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will change back to throw the caught Throwable here.

new SparkException(errorClass = "STORE_BLOCK_ERROR",
messageParameters = Array(blockId.toString), cause = cause)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Let us remove getBlockError, corruptedRemoteBlockError and getLocalBlockError - they are replacing a single invocation site.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you mean by "replacing a single invocation site". Could you elaborate?

override private[spark] def createSparkEnv(
conf: SparkConf,
isLocal: Boolean,
listenerBus: LiveListenerBus) = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix indentation 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.

Will do.

@github-actions
Copy link

github-actions bot commented Jul 4, 2022

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jul 4, 2022
@github-actions github-actions bot closed this Jul 5, 2022
@bozhang2820 bozhang2820 deleted the spark-38461 branch April 24, 2023 07:02
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