Skip to content

Conversation

@iyanuobidele
Copy link
Collaborator

What changes were proposed in this pull request?

  • SparkJob resource watcher using Server Sent Events
  • Moved creation of the SparkJob resource to before driver pod creation
  • Changed clean up logic to handle graceful deletion of the SparkJob Resource
  • etc..

@iyanuobidele
Copy link
Collaborator Author

isObjectDeleted = true
logInfo("TPR Object deleted. Cleaning up")
stop()
case Success(_: WatchObject) => throw new SparkException("Unexpected response received")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print the response?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you mean to add a logInfo or logError? That can be added.

However, If you take a look at SparkJobResource.scala you'll see that the promise is completed with a WatchObject only when its deleted or with an exception when the source is exhausted.

That middle case where the WatchObject is returned and it's state is not deleted is just to exhaust the matches. Looking at it now, I think it should be safe to take it out.

Copy link

@tnachen tnachen Dec 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking at least include the WatchObject in the error message when you don't expect it so we can see what the unexpected value is

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Sounds good.

logInfo("TPR Object deleted. Cleaning up")
stop()
case Success(_: WatchObject) => throw new SparkException("Unexpected response received")
case Failure(e: Throwable) => throw new SparkException(e.getMessage)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stops the Spark job right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This call back is triggered when the source from the server is exhausted (failure case) or the resource being watched is deleted (success case).

On the success case, it stops the spark job by cleaning up the pods.

Pending question is: what is the right thing to do if the callback returns with a failure, right now I defaulted to throwing an error because this means the state of the SparkJob resource is now unknown and the watcher has stopped.

…ic + separating external deletion of resource
@mccheah
Copy link
Collaborator

mccheah commented Feb 22, 2017

@iyanuobidele want to close this in favor of work on apache-spark-on-k8s#126?

@mccheah mccheah closed this Feb 22, 2017
@mccheah mccheah reopened this Feb 22, 2017
@iyanuobidele
Copy link
Collaborator Author

Sure. Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants