This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
fix: Improve advisory locks (follow-up to #482) #483
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #483 +/- ##
==========================================
- Coverage 48.78% 48.77% -0.01%
==========================================
Files 54 54
Lines 8882 8896 +14
==========================================
+ Hits 4333 4339 +6
- Misses 4549 4557 +8
Continue to review full report at Codecov.
|
- This will avoid being affected by arbitrary statement and lock timeout configs as well as TCP keepalive configs, with a small sacrifice on CPU cycles and network traffic at the database connection for each timer. * refactor: Single-source the database creation routine * test: Use newly created database engines in test_distributed.TimerNode to avoid event loop mismatch
achimnol
force-pushed
the
fix/follow-up-of-pr482
branch
from
October 4, 2021 16:45
8c05d80
to
64b74b6
Compare
* "creating" database may be confused with db/schema initialization.
achimnol
changed the title
fix: Ignore DBAPIError for locking error upon service shutdown
fix: Improve advisory locks (follow-up to #482)
Oct 5, 2021
achimnol
added a commit
that referenced
this pull request
Oct 5, 2021
* Use pg_try_advisory_lock() combined with client-side sleep - This will avoid being affected by arbitrary statement and lock timeout configs as well as TCP keepalive configs, with a small sacrifice on CPU cycles and network traffic at the database connection for each timer. * refactor: Single-source the database creation routine as models.utils.connect_database() Backported-From: main (21.09) Backported-To: 21.03
achimnol
added a commit
that referenced
this pull request
Dec 9, 2021
* But preserve other refactoring parts of #483.
achimnol
added a commit
that referenced
this pull request
Dec 14, 2021
achimnol
added a commit
that referenced
this pull request
Dec 14, 2021
achimnol
added a commit
that referenced
this pull request
Dec 14, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up of #482.
pg_try_advisory_lock()
instead of blockingpg_advisory_lock()
to avoid conflicts with statement/lock timeout configurations.models.utils.connect_database()
async context manager.