dev → main: rule usage telemetry, the plugin's derived version, and the backlog since b267037
#136
@@ -374,7 +374,10 @@ async def _claim_parent_row(session, id_column, row_id: int, label: str) -> bool
|
|||||||
held = (await session.execute(
|
held = (await session.execute(
|
||||||
select(id_column)
|
select(id_column)
|
||||||
.where(id_column == row_id)
|
.where(id_column == row_id)
|
||||||
.with_for_update(key_share=True, nowait=True)
|
# BOTH flags: SQLAlchemy spells the four Postgres row locks as a
|
||||||
|
# read/key_share pair, and key_share alone is FOR NO KEY UPDATE —
|
||||||
|
# which would make two refreshes of one record fight each other.
|
||||||
|
.with_for_update(read=True, key_share=True, nowait=True)
|
||||||
)).scalar_one_or_none()
|
)).scalar_one_or_none()
|
||||||
except Exception:
|
except Exception:
|
||||||
# LockNotAvailable: this record is being deleted right now. Not an
|
# LockNotAvailable: this record is being deleted right now. Not an
|
||||||
|
|||||||
Reference in New Issue
Block a user