timescale / prometheus-postgresql-adapter

Use PostgreSQL as a remote storage database for Prometheus
Apache License 2.0
336 stars 66 forks source link

Unlock all Postgres advisory locks on connection release #99

Closed antekresic closed 4 years ago

antekresic commented 4 years ago

When using pg_try_advisory_lock function multiple times, locks stack which means that we would have to unlock it as many times as we lock it. Instead of doing that, we just use pg_advisory_unlock_all to release all the locks for the session.

Fixes #97

codecov[bot] commented 4 years ago

Codecov Report

Merging #99 into master will increase coverage by 0.14%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
+ Coverage    13.8%   13.94%   +0.14%     
==========================================
  Files           4        4              
  Lines         594      588       -6     
==========================================
  Hits           82       82              
+ Misses        497      491       -6     
  Partials       15       15
Impacted Files Coverage Δ
pkg/util/lock.go 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bea6477...ccfb083. Read the comment docs.