<#7260 fix: sort actions ascending when seeding Wa...
# flyte-github
a
#7260 fix: sort actions ascending when seeding WatchActions tree Pull request opened by pingsutw Tracking issue Related to #7192 Why are the changes needed?
WatchActions
currently fails during the initial tree seed with:
Copy code
parent node [a0] not found for action [5jwxenorsaoevdvwpuz9dny93]
listAndSendAllActions
calls
ActionRepo.ListActions
without any
SortParameters
, so it falls through to the repo default set in #7192:
ORDER BY phase ASC, created_at DESC
. Because children are created after their parents,
DESC
returns children first and the run state manager's
insertAction
looks up a parent that has not yet been inserted into
AllNodes
, returning an error and terminating the watch stream. Cloud avoids this by passing an explicit
created_at ASC
sort parameter at the call site (
workflow/service/run_service.go:listAndSendAllActions
). OSS was missing the same override. What changes were proposed in this pull request? • Pass
SortParameters: [{created_at ASC}]
in
listAndSendAllActions
so parents are always inserted into the run state manager before their children. How was this patch tested? •
go build ./runs/...
• Manually reproduced the failing
WatchActions
call against a run with child actions; with the fix the stream seeds without error and emits actions in parent-before-child order. Labels fixed Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. •
main
• #6583 • fix: sort actions ascending when seeding WatchActions tree 👈 flyteorg/flyte