ROX-33509: change psql lock to take lockID argument#19943
ROX-33509: change psql lock to take lockID argument#19943johannes94 wants to merge 3 commits intomasterfrom
Conversation
🚀 Build Images ReadyImages are ready for commit 9c9a412. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-620-g9c9a412eb1 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19943 +/- ##
==========================================
- Coverage 49.56% 49.56% -0.01%
==========================================
Files 2764 2764
Lines 208346 208351 +5
==========================================
- Hits 103276 103269 -7
- Misses 97419 97430 +11
- Partials 7651 7652 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| func makeRelease(conn *postgres.Conn, lockID int64) func() { | ||
| released := false | ||
| return func() { |
There was a problem hiding this comment.
This is probably a theoretical issue, but should we wrap this closure with a sync.Once for extra safety? Example:
var once sync.Once
return func() {
once.Do(func() {
...
})
}|
@johannes94: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
I want to reuse the logic for the PSQL advisory lock for the upcoming background migration implementation, but with a different lock ID. Because of that I:
pkg/dblocklock.goto use that shared PKG with it's constant IDUser-facing documentation
Testing and quality
Automated testing
How I validated my change
Automated tests.