From 694fa2acafbf50d09b1cccb54dcdd3c4aec3c113 Mon Sep 17 00:00:00 2001 From: Joseph Crosland Date: Fri, 17 Sep 2021 13:29:07 -0700 Subject: [PATCH] secscan: continue iterating after failure (PROJQUAY-2563) (#892) If Clair returns an error the current behaviour is to error out, thus not indexing any subsequent manifests. This change allows the worker to continue indexing subsequent manifests after one failure. Signed-off-by: crozzy --- data/secscan_model/secscan_v4_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/secscan_model/secscan_v4_model.py b/data/secscan_model/secscan_v4_model.py index 2c17c1dd7..d5cca47c9 100644 --- a/data/secscan_model/secscan_v4_model.py +++ b/data/secscan_model/secscan_v4_model.py @@ -289,10 +289,10 @@ class V4SecurityScanner(SecurityScannerInterface): except InvalidContentSent as ex: mark_manifest_unsupported(manifest) logger.exception("Failed to perform indexing, invalid content sent") - return None + continue except APIRequestFailure as ex: logger.exception("Failed to perform indexing, security scanner API error") - return None + continue with db_transaction(): ManifestSecurityStatus.delete().where(