prometheus/tsdb/agent
Robert Fratto b71a6dbbd1
tsdb/agent: Fix deadlock from simultaneous GC and write (#10166)
* tsdb/agent: Fix deadlock from simultaneous GC and write

This commit fixes a potential deadlock where storing in-memory series
references could deadlock with a WAL GC cycle.

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* add missing license header

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* order local imports

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* align deadlock testing with discovery/manager_test.go method

Also prevents GCs from running concurrently, which could also cause a
deadlock (even though it's currently impossible for two GCs to run
concurrently).

Signed-off-by: Robert Fratto <robertfratto@gmail.com>
2022-01-19 20:23:06 +05:30
..
db.go tsdb/agent: Synchronize appender code with grafana/agent main (#9664) 2021-11-30 21:14:40 +05:30
db_test.go tsdb/agent: Synchronize appender code with grafana/agent main (#9664) 2021-11-30 21:14:40 +05:30
series.go tsdb/agent: Fix deadlock from simultaneous GC and write (#10166) 2022-01-19 20:23:06 +05:30
series_test.go tsdb/agent: Fix deadlock from simultaneous GC and write (#10166) 2022-01-19 20:23:06 +05:30