Skip to content

[SPARK-14889][Spark Core] scala.MatchError: NONE (of class scala.Enumeration) when spark.scheduler.mode=NONE#12666

Closed
sbcd90 wants to merge 1 commit intoapache:masterfrom
sbcd90:schedulerModeIssue
Closed

[SPARK-14889][Spark Core] scala.MatchError: NONE (of class scala.Enumeration) when spark.scheduler.mode=NONE#12666
sbcd90 wants to merge 1 commit intoapache:masterfrom
sbcd90:schedulerModeIssue

Conversation

@sbcd90
Copy link
Contributor

@sbcd90 sbcd90 commented Apr 25, 2016

What changes were proposed in this pull request?

Handling exception for the below mentioned issue

➜  spark git:(master) ✗ ./bin/spark-shell -c spark.scheduler.mode=NONE
16/04/25 09:15:00 ERROR SparkContext: Error initializing SparkContext.
scala.MatchError: NONE (of class scala.Enumeration$Val)
    at org.apache.spark.scheduler.Pool.<init>(Pool.scala:53)
    at org.apache.spark.scheduler.TaskSchedulerImpl.initialize(TaskSchedulerImpl.scala:131)
    at org.apache.spark.SparkContext$.org$apache$spark$SparkContext$$createTaskScheduler(SparkContext.scala:2352)
    at org.apache.spark.SparkContext.<init>(SparkContext.scala:492)

The exception now looks like

java.lang.RuntimeException: The scheduler mode NONE is not supported by Spark.

How was this patch tested?

manual tests

Copy link
Contributor

Choose a reason for hiding this comment

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

In TaskSchedulerImpl they use: "Unrecognized spark.scheduler.mode: $schedulingModeConf" so I'd change it to "Unsupported spark.scheduler.mode: $schedulingMode".

I'm also not sure about the other places like https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala#L133-L138. I know that the change would not let it be executed with NONE or unsupported scheduling modes, but when Pool changes...just thinking aloud.

@sbcd90 sbcd90 force-pushed the schedulerModeIssue branch from 9ef0bae to 1c524ce Compare April 25, 2016 22:19
@sbcd90
Copy link
Contributor Author

sbcd90 commented Apr 25, 2016

Hi @jaceklaskowski ,

Thanks for your review. I think it is safe that we make the changes at both the places.
I also checked for the occurrence of scheduler mode & I feel it is sufficient to make the changes at these two places only.
I also corrected the exception message now.
Please have a look & comment now.

Copy link
Member

Choose a reason for hiding this comment

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

Use something like IllegalArgumentException

@sbcd90 sbcd90 force-pushed the schedulerModeIssue branch from 1c524ce to 4658936 Compare April 26, 2016 02:16
@sbcd90
Copy link
Contributor Author

sbcd90 commented Apr 26, 2016

Hi @srowen ,

changed to IllegalArgumentException.

@rxin
Copy link
Contributor

rxin commented Apr 26, 2016

LGTM pending Jenkins.

@SparkQA
Copy link

SparkQA commented Apr 26, 2016

Test build #2883 has finished for PR 12666 at commit 4658936.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Apr 26, 2016

Jenkins retest this please

@SparkQA
Copy link

SparkQA commented Apr 26, 2016

Test build #56986 has finished for PR 12666 at commit 4658936.

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

@srowen
Copy link
Member

srowen commented Apr 26, 2016

Merged to master

@asfgit asfgit closed this in f70e4ff Apr 26, 2016
zzcclp added a commit to zzcclp/spark that referenced this pull request Apr 27, 2016
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