Skip to content

Commit

Permalink
Fix TxThrottler init healtcheck args
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo J. Ortega U. <5791035+ejortegau@users.noreply.github.com>
  • Loading branch information
ejortegau committed Dec 18, 2024
1 parent 4ee650f commit 46155c3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,11 @@ func newTxThrottlerState(txThrottler *txThrottler, config *tabletenv.TabletConfi
return state, nil
}


func (ts *txThrottlerStateImpl) initHealthCheck(topoServer *topo.Server, target *querypb.Target) (err error) {
ts.healthCheck, err = healthCheckFactory(ts.ctx, topoServer, target.Cell, target.Keyspace, target.Shard, ts.healthCheckCells)
if err != nil {
ts.healthCheck = nil

return err
}

Expand Down Expand Up @@ -391,7 +392,13 @@ func (ts *txThrottlerStateImpl) healthChecksProcessor(topoServer *topo.Server, t
}

func (ts *txThrottlerStateImpl) makePrimary() {
ts.initHealthCheck()
err := ts.initHealthCheck(ts.txThrottler.topoServer, ts.target)
if err != nil {
log.Errorf("txThrottler: failed to initialize health check while attempting to make primary: %v", err)

return
}

var ctx context.Context
ctx, ts.healthCheckCancel = context.WithCancel(context.Background())

Expand Down

0 comments on commit 46155c3

Please sign in to comment.