Stop stops sending samples to the remote storage and waits for pending sends to complete.
()
| 990 | // Stop stops sending samples to the remote storage and waits for pending |
| 991 | // sends to complete. |
| 992 | func (t *QueueManager) Stop() { |
| 993 | t.logger.Info("Stopping remote storage...") |
| 994 | defer t.logger.Info("Remote storage stopped.") |
| 995 | |
| 996 | close(t.quit) |
| 997 | // Wait for all QueueManager routines to end before stopping shards, metadata watcher, and WAL watcher. This |
| 998 | // is to ensure we don't end up executing a reshard and shards.stop() at the same time, which |
| 999 | // causes a closed channel panic. |
| 1000 | t.wg.Wait() |
| 1001 | t.shards.stop() |
| 1002 | t.watcher.Stop() |
| 1003 | if t.mcfg.Send { |
| 1004 | t.metadataWatcher.Stop() |
| 1005 | } |
| 1006 | t.metrics.unregister() |
| 1007 | } |
| 1008 | |
| 1009 | // StoreSeries keeps track of which series we know about for lookups when sending samples to remote. |
| 1010 | func (t *QueueManager) StoreSeries(series []record.RefSeries, index int) { |