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: send periodic keepalive packets on eventstream connections #5094

Closed
wants to merge 1 commit into from

Conversation

dcherman
Copy link
Member

When Argo is operating behind load balancers / ingress controllers that have
an idle timeout configured, it's not uncommon to get disconnected and have
an error shown in the UI if you're looking at a relatively inactive workflow
or workflow list.

In the SSE spec, :\n is a sequence that you can send to the client which
should be ignored by the client, so we can use that to periodically send
something in the response without affecting the code in the UI at all.

Fixes #5006

Signed-off-by: Daniel Herman dherman@factset.com

When Argo is operating behind load balancers / ingress controllers that have
an idle timeout configured, it's not uncommon to get disconnected and have
an error shown in the UI if you're looking at a relatively inactive workflow
or workflow list.

In the SSE spec, `:\n` is a sequence that you can send to the client which
should be ignored by the client, so we can use that to periodically send
something in the response without affecting the code in the UI at all.

Fixes argoproj#5006

Signed-off-by: Daniel Herman <dherman@factset.com>
webhookInterceptor(rw, r, gwmux)
})

if os.Getenv("ENABLE_SSE_KEEPALIVE") != "" {
Copy link
Member Author

Choose a reason for hiding this comment

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

Initially, I figured it might be good to stick this behind a feature flag for people to try to make sure we don't blow anything up prior to rolling it out generally.

rt.t.Stop()
}

func (rt *realTicker) Reset(d time.Duration) {
Copy link
Member Author

Choose a reason for hiding this comment

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

None of the existing clock libraries that I found (including the one from apimachinery that's in use elsewhere) properly support mocking the Reset method of a ticker, so I implemented a small shim to enable me to mock it in the tests. We can swap to the apimachinery one in the future if they add support

@dcherman
Copy link
Member Author

Closing this for the moment while I'm debugging an error I just found.

@dcherman dcherman closed this Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recurring UI problems when watching the workflow running
1 participant