Reputation: 703
I faced with very unexpected problem when developed some application on Spark.
I have started spark standalone cluster with one master and one worker processes (./sbin/start-master.sh and ./sbin/start-slave.sh).
I'm starting my application from SparkLauncher inside Java code so it looks like this:
new SparkLauncher()
.setSparkHome("...")
.setAppName("...")
.setMaster("spark://admin:7077")
.setConf("spark.executor.extraJavaOptions", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
.startApplication(new SparkAppStateHandler());
And I noticed that no single job was really started. My log was full of messages like this:
WARN TaskSchedulerImpl:66 - Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
I started exploring this problem by tuning spark configuration (changing RAM size allocated to executors, count of cores and so on) but nothing really changed.
Then I removed one line of code in this job configuration:
.setConf("spark.executor.extraJavaOptions", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
And executors started doing their job instantly.
It's important to point the fact that I didn't started any debug process so I didn't suspend any Spark thread.
So can you understand me why the line indicating the need for debug did not allow to Spark running the job? (AFAIK just enabling the debugging port should have no effect on runtime process as long as no external process connects).
Thanks in advance.
Upvotes: 1
Views: 338
Reputation: 543
It could be because you are using "suspend=y". It will cause the JVM to pause at the start of the main() until your debugger connects to it.
Upvotes: 0