prometheus/storage
Chris Marchbanks bfb1500a38
Fix deadlock when stopping a shard (#10279)
If a queue is stopped and one of its shards happens to hit the
batch_send_deadline at the same time a deadlock can occur where stop
holds the mutex and will not release it until the send is finished, but
the send needs the mutex to retrieve the most recent batch. This is
fixed by using a second mutex just for writing.

In addition, the test I wrote exposed a case where during shutdown a
batch could be sent twice due to concurrent calls to queue.Batch() and
queue.FlushAndShutdown(). Protect these with a mutex as well.

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2022-02-11 07:07:41 -07:00
..
remote Fix deadlock when stopping a shard (#10279) 2022-02-11 07:07:41 -07:00
buffer_test.go fix:storage:avoid panic when iterater exhauested (#9945) 2021-12-07 19:50:00 +05:30
buffer.go fix:storage:avoid panic when iterater exhauested (#9945) 2021-12-07 19:50:00 +05:30
fanout_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
fanout.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
generic.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
interface.go Add basic initial developer docs for TSDB (#9451) 2021-11-17 15:51:27 +05:30
lazy.go tsdb: Added ChunkQueryable implementations to db; unified MergeSeriesSets and vertical to single struct. (#7069) 2020-07-31 16:03:02 +01:00
memoized_iterator_test.go fix:storage:avoid panic when iterater exhauested (#9945) 2021-12-07 19:50:00 +05:30
memoized_iterator.go fix:storage:avoid panic when iterater exhauested (#9945) 2021-12-07 19:50:00 +05:30
merge_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
merge.go storage: Fix and improve the Seek method of various iterators (#9878) 2021-11-29 15:17:56 +05:30
noop.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
secondary.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
series_test.go storage: expose bug in iterators #10027 2021-12-16 12:02:15 +01:00
series.go storage: fix bug #10027 in iterators' Seek method 2021-12-16 12:07:35 +01:00