diff --git a/protocol/daemons/pricefeed/client/client_integration_test.go b/protocol/daemons/pricefeed/client/client_integration_test.go index 70e2dfd75ca..9ea60db98b1 100644 --- a/protocol/daemons/pricefeed/client/client_integration_test.go +++ b/protocol/daemons/pricefeed/client/client_integration_test.go @@ -5,7 +5,6 @@ package client_test import ( "fmt" "github.com/cometbft/cometbft/libs/log" - "github.com/dydxprotocol/v4-chain/protocol/app" appflags "github.com/dydxprotocol/v4-chain/protocol/app/flags" "github.com/dydxprotocol/v4-chain/protocol/daemons/flags" "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client" @@ -285,6 +284,7 @@ func (s *PriceDaemonIntegrationTestSuite) SetupTest() { servertypes.DaemonStartupGracePeriod, servertypes.HealthCheckPollFrequency, log.TestingLogger(), + false, ) s.exchangePriceCache = pricefeedserver_types.NewMarketToExchangePrices(pricefeed_types.MaxPriceAge) @@ -337,7 +337,10 @@ func (s *PriceDaemonIntegrationTestSuite) startClient() { testExchangeToQueryDetails, &client.SubTaskRunnerImpl{}, ) - err := s.healthMonitor.RegisterService(s.pricefeedDaemon, app.MaximumDaemonUnhealthyDuration) + err := s.healthMonitor.RegisterService( + s.pricefeedDaemon, + time.Duration(flags.GetDefaultDaemonFlags().Shared.MaximumAllowableDaemonUnhealthySeconds)*time.Second, + ) s.Require().NoError(err) } diff --git a/protocol/daemons/server/types/health_monitor.go b/protocol/daemons/server/types/health_monitor.go index a3114ab0dd5..665f74e3bd7 100644 --- a/protocol/daemons/server/types/health_monitor.go +++ b/protocol/daemons/server/types/health_monitor.go @@ -91,20 +91,6 @@ func (hc *healthChecker) Poll() { // Capture the timestamp of the first failure in a new streak. hc.firstFailureInStreak.Update(now, err) } - hc.logger.Info( - "QQQQQQ Polling health checker", - "service", - hc.healthCheckable.ServiceName(), - "err", - err, - "mostRecentSuccess", - hc.mostRecentSuccess, - "firstFailureInStreak", - hc.firstFailureInStreak.Timestamp(), - "maximumAcceptableUnhealthyDuration", - hc.maximumAcceptableUnhealthyDuration, - ) - // If the service has been unhealthy for longer than the maximum acceptable unhealthy duration, execute the // callback function. if !hc.firstFailureInStreak.IsZero() && @@ -140,7 +126,6 @@ func StartNewHealthChecker( } // The first poll is scheduled after the startup grace period to allow the service to initialize. checker.timer = time.AfterFunc(startupGracePeriod, checker.Poll) - logger.Info("QQQQQQ Starting health checker", "service", healthCheckable.ServiceName()) return checker } @@ -206,8 +191,6 @@ func (hm *HealthMonitor) RegisterServiceWithCallback( hm.lock.Lock() defer hm.lock.Unlock() - hm.logger.Info("QQQQQQ Registering health checker", "service", hc.ServiceName()) - if maximumAcceptableUnhealthyDuration <= 0 { return fmt.Errorf( "health check registration failure for service %v: "+ @@ -232,14 +215,10 @@ func (hm *HealthMonitor) RegisterServiceWithCallback( ) } - hm.logger.Info("QQQQQQ Registering health checker... checking for duplicates", "service", hc.ServiceName()) - if _, ok := hm.serviceToHealthChecker[hc.ServiceName()]; ok { return fmt.Errorf("service %v already registered", hc.ServiceName()) } - hm.logger.Info("QQQQQQ Registering health checker... creating new health checker", "service", hc.ServiceName()) - hm.serviceToHealthChecker[hc.ServiceName()] = StartNewHealthChecker( hc, hm.pollingFrequency, diff --git a/protocol/daemons/server/types/health_monitor_test.go b/protocol/daemons/server/types/health_monitor_test.go index bcbed6bdb55..5f870395c91 100644 --- a/protocol/daemons/server/types/health_monitor_test.go +++ b/protocol/daemons/server/types/health_monitor_test.go @@ -265,7 +265,9 @@ func TestHealthMonitor_DisablePanics_DoesNotPanic(t *testing.T) { hc := mockFailingHealthCheckerWithError("test-service", TestError1) - hm.RegisterService(hc, 10*time.Millisecond) + err := hm.RegisterService(hc, 10*time.Millisecond) + require.NoError(t, err) + defer func() { hm.Stop() }()