You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/27 19:12:57 UTC
[GitHub] [spark] warrenzhu25 commented on a change in pull request #30175: [SPARK-33274][SS] Fix job hang in cp mode when total cores less than total kafka partition
warrenzhu25 commented on a change in pull request #30175:
URL: https://github.com/apache/spark/pull/30175#discussion_r565566452
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala
##########
@@ -37,7 +37,9 @@ class ContinuousSuiteBase extends StreamTest {
new SparkContext(
"local[10]",
"continuous-stream-test-sql-context",
- sparkConf.set("spark.sql.testkey", "true")))
+ sparkConf.set("spark.sql.testkey", "true")
+ .set("spark.executor.cores", "10")
+ ))
Review comment:
Added test case
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/EpochCoordinator.scala
##########
@@ -267,4 +275,16 @@ private[continuous] class EpochCoordinator(
queryWritesStopped = true
context.reply(())
}
+
+ private def checkTotalCores(): Unit = {
+ val numExecutors = session.conf.get("spark.executor.instances", "1").toInt
+ val coresPerExecutor = session.conf.get("spark.executor.cores", "1").toInt
+ val totalCores = numExecutors * coresPerExecutor
+ logDebug(s"Check total cores $totalCores and kafka partition number $numReaderPartitions")
Review comment:
Updated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org