Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/16503#discussion_r96099793
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/OutputCommitCoordinatorSuite.scala
---
@@ -221,6 +229,22 @@ private case class OutputCommitFunctions(tempDirPath:
String) {
if (ctx.attemptNumber == 0) failingOutputCommitter else
successfulOutputCommitter)
}
+ // Receiver should be idempotent for AskPermissionToCommitOutput
+ def callCanCommitMultipleTimes(iter: Iterator[Int]): Unit = {
+ val ctx = TaskContext.get()
+ val canCommit1 = SparkEnv.get.outputCommitCoordinator
+ .canCommit(ctx.stageId(), ctx.partitionId(), ctx.attemptNumber())
+ val canCommit2 = SparkEnv.get.outputCommitCoordinator
+ .canCommit(ctx.stageId(), ctx.partitionId(), ctx.attemptNumber())
+ if(canCommit1 && canCommit2) {
+ Utils.createDirectory(tempDirPath)
--- End diff --
Do you need this? Can you just assert that you got permission both times
(and rely on the exception causing the `runJob` call to fail in the caller)?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]