Page MenuHomeSoftware Heritage

D405.id4548.diff
No OneTemporary

D405.id4548.diff

diff --git a/swh/vault/cookers/base.py b/swh/vault/cookers/base.py
--- a/swh/vault/cookers/base.py
+++ b/swh/vault/cookers/base.py
@@ -6,6 +6,7 @@
import abc
import io
import logging
+from psycopg2.extensions import QueryCanceledError
from swh.model import hashutil
@@ -111,7 +112,11 @@
self.fileobj = BytesIOBundleSizeLimit(size_limit=self.max_bundle_size)
try:
- self.prepare_bundle()
+ try:
+ self.prepare_bundle()
+ except QueryCanceledError:
+ raise PolicyError(
+ "Timeout reached while assembling the requested bundle")
bundle = self.fileobj.getvalue()
# TODO: use proper content streaming instead of put_bundle()
self.backend.put_bundle(self.CACHE_TYPE_KEY, self.obj_id, bundle)

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 5:39 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221721

Event Timeline