Skip to content
Snippets Groups Projects
Commit 1d238f22 authored by zsxwing's avatar zsxwing Committed by Reynold Xin
Browse files

[SPARK-4664][Core] Throw an exception when spark.akka.frameSize > 2047

If `spark.akka.frameSize` > 2047, it will overflow and become negative. Should have some assertion in `maxFrameSizeBytes` to warn people.

Author: zsxwing <zsxwing@gmail.com>

Closes #3527 from zsxwing/SPARK-4664 and squashes the following commits:

0089c7a [zsxwing] Throw an exception when spark.akka.frameSize > 2047
parent 6384f42a
No related branches found
No related tags found
No related merge requests found
......@@ -134,9 +134,16 @@ private[spark] object AkkaUtils extends Logging {
Duration.create(conf.getLong("spark.akka.lookupTimeout", 30), "seconds")
}
private val AKKA_MAX_FRAME_SIZE_IN_MB = Int.MaxValue / 1024 / 1024
/** Returns the configured max frame size for Akka messages in bytes. */
def maxFrameSizeBytes(conf: SparkConf): Int = {
conf.getInt("spark.akka.frameSize", 10) * 1024 * 1024
val frameSizeInMB = conf.getInt("spark.akka.frameSize", 10)
if (frameSizeInMB > AKKA_MAX_FRAME_SIZE_IN_MB) {
throw new IllegalArgumentException("spark.akka.frameSize should not be greater than "
+ AKKA_MAX_FRAME_SIZE_IN_MB + "MB")
}
frameSizeInMB * 1024 * 1024
}
/** Space reserved for extra data in an Akka message besides serialized task or task result. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment