Release readiness probe database transactions
This commit is contained in:
parent
14b8121c71
commit
d4a13275d0
2 changed files with 11 additions and 2 deletions
|
|
@ -591,7 +591,12 @@ class PostgresUserEngineStore:
|
|||
""",
|
||||
(LATEST_SCHEMA_VERSION,),
|
||||
)
|
||||
return cursor.fetchone() is not None
|
||||
present = cursor.fetchone() is not None
|
||||
# psycopg starts a transaction even for this readiness SELECT.
|
||||
# End it immediately so probes cannot retain relation locks that
|
||||
# block the next replica's idempotent schema migration.
|
||||
self.connection.rollback()
|
||||
return present
|
||||
except Exception:
|
||||
self.connection.rollback()
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue