Skip to content

Commit

Permalink
Revert debug statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal Lemire committed Nov 23, 2023
1 parent 85e2d14 commit d617be3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
7 changes: 5 additions & 2 deletions protocol/daemons/pricefeed/client/client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -285,6 +284,7 @@ func (s *PriceDaemonIntegrationTestSuite) SetupTest() {
servertypes.DaemonStartupGracePeriod,
servertypes.HealthCheckPollFrequency,
log.TestingLogger(),
false,
)

s.exchangePriceCache = pricefeedserver_types.NewMarketToExchangePrices(pricefeed_types.MaxPriceAge)
Expand Down Expand Up @@ -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)
}

Expand Down
21 changes: 0 additions & 21 deletions protocol/daemons/server/types/health_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() &&
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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: "+
Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion protocol/daemons/server/types/health_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}()
Expand Down

0 comments on commit d617be3

Please sign in to comment.