zodb / relstorage

A backend for ZODB that stores pickles in a relational database.
Other
54 stars 46 forks source link

Reverse the order of locking #470

Closed jamadden closed 3 years ago

jamadden commented 3 years ago

Fixes #469.

Also explicitly distinguishes exceptions that are caused by deadlocks (in PostgreSQL and MySQL); those shouldn't be happening anymore after this.

PostgreSQL goes from heuristic to deterministic about which lock error it raises (and is always sure to unlock rows if there is a share lock conflict).

/cc @jzuech3 @cutz

jzuech3 commented 3 years ago

I'm not incredibly familiar with this code, but it LGTM. The reasoning to avoid deadlocks also seems sound. Thanks!

jamadden commented 3 years ago

Thanks. I plan to release this to PyPI as 3.5.0a1 as soon as CI finishes going green. Wheels should be available within two hours.