influxdb/pkg
Jeff Wendling 0fae44e219 storage: fix problems with keeping resources alive
This commit adds the pkg/lifecycle.Resource to help manage opening,
closing, and leasing out references to some resource. A resource
cannot be closed until all acquired references have been released.
If the debug_ref tag is enabled, all resource acquisitions keep
track of the stack trace that created them and have a finalizer
associated with them to print on stderr if they are leaked. It also
registers a handler on SIGUSR2 to dump all of the currently live
resources.

Having resources tracked in a uniform way with a data type allows us
to do more sophisticated tracking with the debug_ref tag, as well.
For example, we could panic the process if a resource cannot be
closed within a certain time frame, or attempt to figure out the
DAG of resource ownership dynamically.

This commit also fixes many issues around resources, correctness
during error scenarios, reporting of errors, idempotency of
close, tracking of memory for some data structures, resource leaks
in tests, and out of order dependency closes in tests.
2019-02-28 10:22:01 -07:00
..
binaryutil Initial import pkg package 2018-10-01 12:03:20 +01:00
bloom chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
bytesutil chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
data/gen chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
encoding/simple8b chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
escape chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
estimator chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
file Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00
lifecycle storage: fix problems with keeping resources alive 2019-02-28 10:22:01 -07:00
limiter chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
metrics chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
mmap chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
pool chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
rhh chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
slices chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
snowflake Initial import pkg package 2018-10-01 12:03:20 +01:00
testing/assert chore(gen): Add ingen generator data structures to platform for reuse 2018-12-11 17:45:57 -07:00