dongjoon-hyun commented on code in PR #44692:
URL: https://github.com/apache/spark/pull/44692#discussion_r1449281353
##########
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:
No, that behavior is defined by K8s in the PR description
(https://kubernetes.io/docs/reference/using-api/health-checks/)
> so if the master is not ready, we treat it as an error (i.e., usually
handleError signals that an exception has been thrown)?
In this context, the readiness is `non-STANDBY` mode because of the existing
workaround which is used in K8s.
> But it is not ready doesn't mean it is an error, right?
--
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]