dongjoon-hyun commented on code in PR #44692:
URL: https://github.com/apache/spark/pull/44692#discussion_r1449284483
##########
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:
Mostly, it's determined by HTTPS status. In this case, 503, instead of the
content of message.
```
$ curl -vv http://localhost:6066/v1/submissions/readyz
...
< HTTP/1.1 503 Service Unavailable
```
--
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]