viirya commented on code in PR #44692:
URL: https://github.com/apache/spark/pull/44692#discussion_r1449270075
##########
core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionServer.scala:
##########
@@ -268,6 +270,31 @@ private[rest] abstract class ClearRequestServlet extends
RestServlet {
protected def handleClear(): ClearResponse
}
+/**
+ * A servlet for handling readyz requests passed to the
[[RestSubmissionServer]].
+ */
+private[rest] abstract class ReadyzRequestServlet extends RestServlet {
+
+ /**
+ * Return the status of master is ready or not.
+ */
+ protected override def doGet(
+ request: HttpServletRequest,
+ response: HttpServletResponse): Unit = {
+ val readyzResponse = handleReadyz()
+ val responseMessage = if (readyzResponse.success) {
+ response.setStatus(HttpServletResponse.SC_OK)
+ readyzResponse
+ } else {
+ response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE)
+ handleError("Master is not ready.")
Review Comment:
Hmm, so if the master is not ready, we treat it as an error (i.e., usually
`handleError` signals that an exception has been thrown)? Or we should return a
`ReadyzResponse` with success set to false?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]