From c4948be03eaa02f70771fd583f3d64d5006beff1 Mon Sep 17 00:00:00 2001 From: "Mitch Harding (the weird one)" Date: Mon, 11 Mar 2024 15:25:15 -0400 Subject: [PATCH] CASMCMS-8946: Update base operator to handle case where all nodes to act on have exceeded their retry limit (cherry picked from commit b3946d6efa2948795db1bf706d86d471b605bacf) --- CHANGELOG.md | 2 ++ src/bos/operators/base.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb563c96..ae60b84f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Update base operator to handle case where all nodes to act on have exceeded their retry limit ## [2.10.7] - 2024-03-08 ### Changed diff --git a/src/bos/operators/base.py b/src/bos/operators/base.py index 63798c74..92ce59f8 100644 --- a/src/bos/operators/base.py +++ b/src/bos/operators/base.py @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP +# (C) Copyright 2021-2024 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -117,6 +117,9 @@ def _run(self) -> None: LOGGER.info('Found {} components that require action'.format(len(components))) if self.retry_attempt_field: # Only check for failed components if we track retries for this operator components = self._handle_failed_components(components) + if not components: + LOGGER.debug('After removing components that exceeded their retry limit, 0 components require action') + return for component in components: # Unset old errors components component['error'] = '' try: