diff --git a/CHANGELOG.md b/CHANGELOG.md index 8740b70aac..9a58fb032b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,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 diff --git a/pkg/reloader/reloader.go b/pkg/reloader/reloader.go index 1072026c2a..2057ea5f75 100644 --- a/pkg/reloader/reloader.go +++ b/pkg/reloader/reloader.go @@ -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 } }