-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.5 Pagination may not work correctly for archived workflows #11715
Comments
@sunyeongchoi Would you like to help take a look at this? Your recent PRs on pagination (#11703, #11684) brought my attention to this part of the code. |
@terrytangyuan |
Hello. I would like to share the results of my analysis on the issue so far. func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.WorkflowListRequest) (*wfv1.WorkflowList, error) {
wfClient := auth.GetWfClient(ctx)
listOption := &metav1.ListOptions{}
if req.ListOptions != nil {
listOption = req.ListOptions
}
s.instanceIDService.With(listOption)
wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(ctx, *listOption)
if err != nil {
return nil, sutils.ToStatusError(err, codes.Internal)
}
// In this part, always return err. Because archived workflows use int type continue not string type(workflows use).
archivedWfList, err := s.wfArchiveServer.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowsRequest{
ListOptions: listOption,
NamePrefix: "",
Namespace: req.Namespace,
})
if err != nil {
log.Warnf("unable to list archived workflows:%v", err)
} else {
if archivedWfList != nil {
wfList = mergeWithArchivedWorkflows(*wfList, *archivedWfList, int(listOption.Limit))
}
}
... In the given code, we cannot fetch data unconditionally in ListArchivedWorkflows. This is because the continue value used in ListArchivedWorkflows is of type int, whereas in Workflows, it's a string. As a result, it always leads to an error. This error is being logged as follows: In essence, this problem arises because, as mentioned earlier, Workflows and ArchivedWorkflows use different pagination methods, and the issue occurs when we try to use the list options from Workflows in ArchivedWorkflows. It would be a good idea for us to discuss how to address this issue together. |
I have one question. After version |
Yes that's exactly what the issue is! Let me know if you can come up with solution to merge the two lists or pagination methods.
Yes, we removed the archived workflows page and both types of workflows are now displayed in one list view. |
This should be re-resolved by #12736 now |
Pre-requisites
:latest
What happened/what you expected to happen?
When we perform the merge of live workflows and archived workflows (in order to only show one of them in the UI), the
listMeta
inWorkflowList
is obtained from live workflows. This may cause issues for pagination for archived workflows.We need to test the pagination more thoroughly and revisit this part of the code. https://github.com/argoproj/argo-workflows/blob/master/server/workflow/workflow_server.go#L155C2-L155C86
Version
latest
Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
TBA
Logs from the workflow controller
Logs from in your workflow's wait container
The text was updated successfully, but these errors were encountered: