This repository was archived by the owner on Dec 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 4848STIX_EXT_OCTI_SCO = "extension-definition--f93e2c80-4231-4f9a-af8b-95c9bd566a82"
4949STIX_EXT_MITRE = "extension-definition--322b8f77-262a-4cb8-a915-1e441e00329b"
5050PROCESSING_COUNT : int = 4
51+ MAX_PROCESSING_COUNT : int = 100
5152
5253meter = metrics .get_meter (__name__ )
5354bundles_timeout_error_counter = meter .create_counter (
@@ -2489,6 +2490,20 @@ def import_item(
24892490 work_id : str = None ,
24902491 ):
24912492 worker_logger = self .opencti .logger_class ("worker" )
2493+ # Ultimate protection to avoid infinite retry
2494+ if processing_count > MAX_PROCESSING_COUNT :
2495+ if work_id is not None :
2496+ item_str = json .dumps (item )
2497+ self .opencti .work .report_expectation (
2498+ work_id ,
2499+ {
2500+ "error" : "Max number of retries reached, please see error logs of workers for more details" ,
2501+ "source" : (
2502+ item_str if len (item_str ) < 50000 else "Bundle too large"
2503+ ),
2504+ },
2505+ )
2506+ return False
24922507 try :
24932508 self .opencti .set_retry_number (processing_count )
24942509 opencti_operation = self .opencti .get_attribute_in_extension (
You can’t perform that action at this time.
0 commit comments