prometheus/scrape
Björn Rabenstein d80b0810c1
Move crucial actions to defer (#6918)
With defer having less of a performance penalty, there is no reason
not to do those crucial operations via defer.

Context: With isolation in place, if we forget to Commit/Rollback, the
low watermark will get stuck forever.

The current code should not have any bugs, but moving to defer helps
to avoid future bugs.

This is also moving the `closeAppend` in the `Commit` implementation
itself to defer. If logging to the WAL fails, we would have missed the
`closeAppend`.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-03-13 20:54:47 +01:00
..
testdata rename package retrieve to scrape 2018-02-01 09:55:07 +00:00
helpers_test.go Unify Iterator interfaces. All point to storage now. 2020-02-17 18:03:54 +00:00
manager.go Unify Iterator interfaces. All point to storage now. 2020-02-17 18:03:54 +00:00
manager_test.go Improve testutil.ErrorEqual (#6471) 2019-12-17 21:11:33 +00:00
scrape.go Move crucial actions to defer (#6918) 2020-03-13 20:54:47 +01:00
scrape_test.go tsdb: don't allow ingesting empty labelsets (#6891) 2020-03-02 07:18:05 +00:00
target.go Unify Iterator interfaces. All point to storage now. 2020-02-17 18:03:54 +00:00
target_test.go Update go.mod dependencies before release (#5883) 2019-08-14 11:00:39 +02:00