shutdown stops the instance and flushes any remaining data. After shutdown is called pushSpans should not be called anymore.
()
| 455 | // shutdown stops the instance and flushes any remaining data. After shutdown |
| 456 | // is called pushSpans should not be called anymore. |
| 457 | func (i *instance) shutdown() { |
| 458 | close(i.shutdownCh) |
| 459 | |
| 460 | i.processorsMtx.Lock() |
| 461 | defer i.processorsMtx.Unlock() |
| 462 | |
| 463 | for processorName := range i.processors { |
| 464 | i.removeProcessor(processorName) |
| 465 | } |
| 466 | |
| 467 | i.registry.Close() |
| 468 | |
| 469 | err := i.wal.Close() |
| 470 | if err != nil { |
| 471 | level.Error(i.logger).Log("msg", "closing wal failed", "tenant", i.instanceID, "err", err) |
| 472 | } |
| 473 | } |