summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorOlivier Dony <odo@odoo.com>2019-12-12 18:44:04 +0000
committerOlivier Dony <odo@odoo.com>2019-12-12 18:44:32 +0000
commite63fd04b512b6a2358b3374cea081bdbd327fcd4 (patch)
tree8a343c6a33c6e965997b8c885c57dbe9b9d8f342 /addons/web/static/src/js/views/basic
parentd807e079492e3ce93e99c87e28d7f801bb872aee (diff)
[FIX] ir.attachment: make filestore GC yield to other transactions
If a long-running transaction holds a write-lock on any row in ir.attachment, the GC job can wait an indefinite amount of time to acquire its table-wise SHARE LOCK. While sitting in the queue for this lock, it will conflict with any future transaction that tries to acquire a write-lock on any row [1]. So the GC transaction, which would normally execute very fast and immediately release its lock, will start to block other transactions and cause severe delays in response time. It basically depends on how long the tx holding the lock takes to complete... which is unknown. As a workaround, we force an arbitrary (but short) lock_timeout in the GC tx before attempting the lock. If it fails to acquire it, it will fail and raise, causing the whole operation to abort. The cron job will be rescheduled quickly because it failed to complete, giving the GC another chance to complete. 10 seconds seems a reasonable compromise, as it gives the blocking transaction(s) some time to complete before bailing out, yet should not be long enough to bring the system to a halt due to other transactions blocked by the GC one. I have no hard data to back this claim, though. [1] See the LOCK conflict table in the documentation: https://www.postgresql.org/docs/10/explicit-locking.html closes odoo/odoo#42128 X-original-commit: 8a093c74c209d492f066c927cc4ac61325aee3ae Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
0 files changed, 0 insertions, 0 deletions