diff --git a/core/services/health.go b/core/services/health.go index b9367429dbf..da3a99b34d9 100644 --- a/core/services/health.go +++ b/core/services/health.go @@ -252,11 +252,7 @@ func (i *InBackupHealthReport) Stop() { func (i *InBackupHealthReport) Start() { go func() { http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusServiceUnavailable) - _, err := w.Write([]byte("Database backup in progress...")) - if err != nil { - i.lggr.Errorf("Cannot write response to /health") - } + w.WriteHeader(http.StatusNoContent) }) i.lggr.Info("Starting InBackupHealthReport") if err := i.server.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) { diff --git a/core/services/health_test.go b/core/services/health_test.go index 56c91277e4c..295eb86119c 100644 --- a/core/services/health_test.go +++ b/core/services/health_test.go @@ -2,7 +2,6 @@ package services_test import ( "fmt" - "io" "net/http" "testing" "time" @@ -81,11 +80,7 @@ func TestNewInBackupHealthReport(t *testing.T) { res, err := http.Get("http://localhost:1234/health") require.NoError(t, err) - require.Equal(t, http.StatusServiceUnavailable, res.StatusCode) - - resBody, err := io.ReadAll(res.Body) - require.NoError(t, err) - require.Equal(t, "Database backup in progress...", string(resBody)) + require.Equal(t, http.StatusNoContent, res.StatusCode) ibhr.Stop() require.Eventually(t, func() bool { return observed.Len() >= 1 }, time.Second*5, time.Millisecond*100) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index aa98a138c86..d2e3dfada9b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -26,7 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ```[ERROR] Error in transaction, rolling back: session missing or expired, please login again pg/transaction.go:118 ``` - Fixed a bug that was preventing job runs to be displayed when the job `chainID` was disabled. - `chainlink txs evm create` returns a transaction hash for the attempted transaction in the CLI. Previously only the sender, recipient and `unstarted` state were returned. -- Fixed a bug when when `evmChainId` is requested instead of `id` or `evm-chain-id` in CLI error verbatim +- Fixed a bug where `evmChainId` is requested instead of `id` or `evm-chain-id` in CLI error verbatim +- Fixed a bug that would cause the node to shut down while performing backup ## 2.5.0 - UNRELEASED =======