Skip to content

Commit

Permalink
defer cancel for healthcheck timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
csmarchbanks committed Mar 12, 2018
1 parent f9790f4 commit 003d6b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ func (d *Distributor) healthCheckAndRemoveIngester(addr string, client client.In
level.Debug(util.Logger).Log("msg", "healthchecking ingester client", "addr", addr)

ctx, cancel := context.WithTimeout(context.Background(), d.cfg.RemoteTimeout)
defer cancel()
ctx = user.InjectOrgID(ctx, "0")
resp, err := client.Check(ctx, &ingester_client.HealthCheckRequest{})
cancel()
if err != nil || resp.Status != ingester_client.SERVING {
level.Warn(util.Logger).Log("msg", "removing ingester client failing healthcheck", "addr", addr, "reason", err)

Expand Down

0 comments on commit 003d6b9

Please sign in to comment.