MCPcopy
hub / github.com/grafana/dskit / running

Method running

ring/partition_instance_lifecycler.go:181–205  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

179}
180
181func (l *PartitionInstanceLifecycler) running(ctx context.Context) error {
182 reconcile := func() {
183 l.reconcileOwnedPartition(ctx, time.Now())
184 l.reconcileOtherPartitions(ctx, time.Now())
185 }
186
187 // Run a reconciliation as soon as the lifecycler, in order to not having to wait for the 1st timer tick.
188 reconcile()
189
190 reconcileTicker := time.NewTicker(l.cfg.PollingInterval)
191 defer reconcileTicker.Stop()
192
193 for {
194 select {
195 case <-reconcileTicker.C:
196 reconcile()
197
198 case f := <-l.actorChan:
199 f()
200
201 case <-ctx.Done():
202 return nil
203 }
204 }
205}
206
207func (l *PartitionInstanceLifecycler) stopping(_ error) error {
208 level.Info(l.logger).Log("msg", "partition ring lifecycler is shutting down", "ring", l.ringName)

Callers

nothing calls this directly

Calls 4

StopMethod · 0.65
DoneMethod · 0.65

Tested by

no test coverage detected