diff --git a/fs_attachment/__manifest__.py b/fs_attachment/__manifest__.py index bb8fe1ca10..4375ae4bcf 100644 --- a/fs_attachment/__manifest__.py +++ b/fs_attachment/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Base Attachment Object Store", "summary": "Store attachments on external object store", - "version": "16.0.2.0.1", + "version": "16.0.2.0.2", "author": "Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA)", "license": "AGPL-3", "development_status": "Beta", diff --git a/fs_attachment/models/fs_file_gc.py b/fs_attachment/models/fs_file_gc.py index 6ab70ec38e..02cc01e7ac 100644 --- a/fs_attachment/models/fs_file_gc.py +++ b/fs_attachment/models/fs_file_gc.py @@ -44,6 +44,18 @@ def _in_new_cursor(self) -> Cursor: with closing(self.env.registry.cursor()) as cr: try: + # Bound this cursor so it cannot hold a row lock on + # fs_file_gc indefinitely. Without these guards, a slow + # external storage backend (e.g. S3, Azure Blob) can leave + # the cursor "idle in transaction" while waiting on I/O, + # serialising every attachment write behind the unique + # constraint lock on fs_file_gc.store_fname. Every queued + # POST /mail/attachment/upload then times out at the + # session statement_timeout and returns a 500 HTML page, + # which the frontend tries to JSON.parse and fails with + # "Unexpected token '<', \"