Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/reloader: use watchInterval timeout for initial apply #6519

Merged
merged 4 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#6325](https://github.com/thanos-io/thanos/pull/6325) Store: return gRPC resource exhausted error for byte limiter.
- [#6399](https://github.com/thanos-io/thanos/pull/6399) *: Fix double-counting bug in http_request_duration metric
- [#6428](https://github.com/thanos-io/thanos/pull/6428) Report gRPC connnection errors in the logs.
- [#6519](https://github.com/thanos-io/thanos/pull/6519) Reloader: Use timeout for initial apply.
- [#6509](https://github.com/thanos-io/thanos/pull/6509) Store Gateway: Remove `memWriter` from `fileWriter` to reduce memory usage when sync index headers.

### Changed
Expand Down
6 changes: 4 additions & 2 deletions pkg/reloader/reloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ func (r *Reloader) Watch(ctx context.Context) error {
if err := r.watcher.addFile(r.cfgFile); err != nil {
return errors.Wrapf(err, "add config file %s to watcher", r.cfgFile)
}

if err := r.apply(ctx); err != nil {
initialSyncCtx, initialSyncCancel := context.WithTimeout(ctx, r.watchInterval)
err := r.apply(initialSyncCtx)
initialSyncCancel()
if err != nil {
return err
}
}
Expand Down