From 8fa1560e489eaa39eec31f2f930a49b9d443c230 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 23 Feb 2016 15:30:56 +0100 Subject: [PATCH] Fix a very special case of handling the checkpoint timer --- storage/local/storage.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/local/storage.go b/storage/local/storage.go index b10708b20..55f81bd36 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -966,6 +966,13 @@ loop: } else { dirtySeriesCount = 0 } + // If a checkpoint takes longer than checkpointInterval, unluckily timed + // combination with the Reset(0) call below can lead to a case where a + // time is lurking in C leading to repeated checkpointing without break. + select { + case <-checkpointTimer.C: // Get rid of the lurking time. + default: + } checkpointTimer.Reset(s.checkpointInterval) case fp := <-memoryFingerprints: if s.maintainMemorySeries(fp, model.Now().Add(-s.dropAfter)) {