Skip to content

Commit 130b963

Browse files
author
Jeny Sadadia
committed
Only send final retry of incomplete jobs
Do not send all incomplete jobs and wait for the final retry to be submitted to KCIDB. Signed-off-by: Jeny Sadadia <[email protected]>
1 parent d61501e commit 130b963

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/send_kcidb.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,14 @@ def _find_unprocessed_node(self, chunksize):
638638
'updated__lt': datetime.datetime.now() - datetime.timedelta(minutes=5),
639639
'limit': chunksize,
640640
})
641+
nodes = [
642+
node for node in nodes
643+
if not (
644+
node["kind"] in ("kbuild", "job")
645+
and node["result"] == "incomplete"
646+
and node["retry_counter"] != 3
647+
)
648+
]
641649
except Exception as exc:
642650
self.log.error(f"Failed to find unprocessed nodes: {str(exc)}")
643651
return []
@@ -701,6 +709,10 @@ def _run(self, context):
701709
node = None
702710
try:
703711
node, is_hierarchy = self._api_helper.receive_event_node(context['sub_id'])
712+
if node["kind"] in ("kbuild", "job"):
713+
if node["result"] == "incomplete" and node["retry_counter"] != 3:
714+
# Only send final retry for incomplete jobs
715+
continue
704716
except Exception as e:
705717
self.log.error(f"Error receiving event: {e}, re-subscribing in 10 seconds")
706718
time.sleep(10)

0 commit comments

Comments
 (0)