Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit 26f747e

Browse files
erikerlandsonash211
authored andcommitted
Fix watcher conditional logic (#269)
1 parent 0a8080a commit 26f747e

File tree

1 file changed

+4
-2
lines changed
  • resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/submit/v1

1 file changed

+4
-2
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/submit/v1/Client.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,9 @@ private[spark] class Client(
538538
private class DriverEndpointsReadyWatcher(resolvedDriverEndpoints: SettableFuture[Endpoints])
539539
extends Watcher[Endpoints] {
540540
override def eventReceived(action: Action, endpoints: Endpoints): Unit = {
541-
if ((action == Action.ADDED) || (action == Action.MODIFIED)
541+
if ((action == Action.ADDED || action == Action.MODIFIED)
542+
&& (endpoints != null)
543+
&& (endpoints.getSubsets != null)
542544
&& endpoints.getSubsets.asScala.nonEmpty
543545
&& endpoints.getSubsets.asScala.exists(_.getAddresses.asScala.nonEmpty)
544546
&& !resolvedDriverEndpoints.isDone) {
@@ -554,7 +556,7 @@ private[spark] class Client(
554556
private class DriverServiceReadyWatcher(resolvedDriverService: SettableFuture[Service])
555557
extends Watcher[Service] {
556558
override def eventReceived(action: Action, service: Service): Unit = {
557-
if ((action == Action.ADDED) || (action == Action.MODIFIED)
559+
if ((action == Action.ADDED || action == Action.MODIFIED)
558560
&& !resolvedDriverService.isDone) {
559561
resolvedDriverService.set(service)
560562
}

0 commit comments

Comments
 (0)