Skip to content

Commit 6bdd4d7

Browse files
author
Jeny Sadadia
committed
Reflect change in signature of api_helper.receive_event_node
API helper function to get node and other information from event has been changed to send `is_retry` flag. This flag is useful to detect if the event was raised to schedule a job retry. Update pipeline services that use the helper function accordingly. Do not process retry events in KCIDB bridge service to avoid sending the same parent node again. The event is intended for scheduler service. Signed-off-by: Jeny Sadadia <[email protected]>
1 parent c24b51f commit 6bdd4d7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/send_kcidb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,10 @@ def _run(self, context):
698698
# Listen and wait for a node instead of processing the queue
699699
node = None
700700
try:
701-
node, is_hierarchy = self._api_helper.receive_event_node(context['sub_id'])
701+
node, is_hierarchy, is_retry = self._api_helper.receive_event_node(context['sub_id'])
702+
if is_retry:
703+
# Do not re-submit parent node when a node is submitted for a retry
704+
continue
702705
except Exception as e:
703706
self.log.error(f"Error receiving event: {e}, re-subscribing in 10 seconds")
704707
time.sleep(10)

src/tarball.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _run(self, sub_id):
212212
while True:
213213
checkout_node = None
214214
try:
215-
checkout_node, _ = self._api_helper.receive_event_node(sub_id)
215+
checkout_node, _, _ = self._api_helper.receive_event_node(sub_id)
216216
except Exception as e:
217217
self.log.error(f"Error receiving event: {e}, re-subscribing in 10 seconds")
218218
time.sleep(10)

0 commit comments

Comments
 (0)