Skip to content

Commit cb0eae3

Browse files
brndnmtthwsAndrew Or
authored andcommitted
[SPARK-4158] Fix for missing resources.
Mesos offers may not contain all resources, and Spark needs to check to ensure they are present and sufficient. Spark may throw an erroneous exception when resources aren't present. Author: Brenden Matthews <[email protected]> Closes #3024 from brndnmtthws/fix-mesos-resource-misuse and squashes the following commits: e5f9580 [Brenden Matthews] [SPARK-4158] Fix for missing resources.
1 parent f7ac8c2 commit cb0eae3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ private[spark] class CoarseMesosSchedulerBackend(
242242
for (r <- res if r.getName == name) {
243243
return r.getScalar.getValue
244244
}
245-
// If we reached here, no resource with the required name was present
246-
throw new IllegalArgumentException("No resource called " + name + " in " + res)
245+
0
247246
}
248247

249248
/** Build a Mesos resource protobuf object */

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ private[spark] class MesosSchedulerBackend(
278278
for (r <- res if r.getName == name) {
279279
return r.getScalar.getValue
280280
}
281-
// If we reached here, no resource with the required name was present
282-
throw new IllegalArgumentException("No resource called " + name + " in " + res)
281+
0
283282
}
284283

285284
/** Turn a Spark TaskDescription into a Mesos task */

0 commit comments

Comments
 (0)