Skip to content
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

fix(controller): Fixes resource version misuse. Fixes #4714 #4741

Merged
merged 2 commits into from Dec 15, 2020

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Dec 14, 2020

Signed-off-by: Alex Collins alex_collins@intuit.com

Checklist:

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@@ -74,7 +74,8 @@ func waitOnOne(serviceClient workflowpkg.WorkflowServiceClient, ctx context.Cont
req := &workflowpkg.WatchWorkflowsRequest{
Namespace: namespace,
ListOptions: &metav1.ListOptions{
FieldSelector: util.GenerateFieldSelectorFromWorkflowName(wfName),
FieldSelector: util.GenerateFieldSelectorFromWorkflowName(wfName),
ResourceVersion: "0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0" means, start from the latest version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nifty trick

@@ -210,13 +211,7 @@ func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest,
return nil
case event, open := <-watch.ResultChan():
if !open {
log.Debug("Re-establishing workflow watch")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the client must have re-connection logic, we should not try and mask/mitigate the problem here

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@@ -43,7 +43,22 @@ export default {
return Observable.create((observer: Observer<any>) => {
const eventSource = new EventSource(url);
eventSource.onmessage = x => observer.next(x.data);
eventSource.onerror = x => observer.error(x);
eventSource.onerror = x => {
switch (eventSource.readyState) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some users are creating "unknown error" issues - lets provide clearer error message

@alexec alexec marked this pull request as ready for review December 15, 2020 00:17
@alexec alexec merged commit 2e278b0 into argoproj:master Dec 15, 2020
@alexec alexec deleted the fix-watch branch December 15, 2020 20:24
@alexec alexec linked an issue Dec 17, 2020 that may be closed by this pull request
@simster7 simster7 mentioned this pull request Dec 17, 2020
9 tasks
simster7 pushed a commit that referenced this pull request Dec 17, 2020
Signed-off-by: Alex Collins <alex_collins@intuit.com>
@alexec alexec linked an issue Dec 19, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Argo UI: Unknown error argo watch can fail with too old resource version
2 participants