This is an automated email from the ASF dual-hosted git repository.

pbacsko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new db70ca6e [YUNIKORN-1997] Yunikorn Status page fails when scheduler is 
not healthy (#718)
db70ca6e is described below

commit db70ca6e0ed46eb93362fc1bf48545781146f534
Author: Cliff Su <[email protected]>
AuthorDate: Sun Nov 19 14:56:56 2023 +0100

    [YUNIKORN-1997] Yunikorn Status page fails when scheduler is not healthy 
(#718)
    
    Closes: #718
    
    Signed-off-by: Peter Bacsko <[email protected]>
---
 pkg/webservice/handlers.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/webservice/handlers.go b/pkg/webservice/handlers.go
index 92cc472e..4b7cacdd 100644
--- a/pkg/webservice/handlers.go
+++ b/pkg/webservice/handlers.go
@@ -492,7 +492,9 @@ func checkHealthStatus(w http.ResponseWriter, r 
*http.Request) {
        if result != nil {
                if !result.Healthy {
                        log.Log(log.SchedHealth).Error("Scheduler is not 
healthy", zap.Any("health check info", *result))
-                       buildJSONErrorResponse(w, "Scheduler is not healthy", 
http.StatusServiceUnavailable)
+                       if err := json.NewEncoder(w).Encode(result); err != nil 
{
+                               buildJSONErrorResponse(w, err.Error(), 
http.StatusInternalServerError)
+                       }
                } else {
                        log.Log(log.SchedHealth).Info("Scheduler is healthy", 
zap.Any("health check info", *result))
                        if err := json.NewEncoder(w).Encode(result); err != nil 
{


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to