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

Handle the first /sync failure differently. #216

Merged
merged 3 commits into from
Sep 23, 2016

Conversation

erikjohnston
Copy link
Member

A /sync request may spuriously fail on occasion, without the "connection" actually being lost. To avoid spurious "Connection Lost" warning messages we ignore the first /sync and immediately retry, and only if that fails do we enter an ERROR state.

Is this sensible? Should we emit an event to indicate we may have lost a connection?

A /sync request may spuriously fail on occasion, without the
"connection" actually being lost. To avoid spurious "Connection Lost"
warning messages we ignore the first /sync and immediately retry, and
only if that fails do we enter an ERROR state.
@erikjohnston erikjohnston changed the base branch from master to develop September 22, 2016 16:04
self._syncConnectionLost = true;
self._startKeepAlives().done(function() {
if (!self._syncConnectionLost) {
// This is the first failure, which may be spurious. To avoid unnecessary
Copy link
Member

Choose a reason for hiding this comment

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

"which may be spurious" - Can you give examples on this please as per RL discussion. Namely that things like restarting servers / load balancers / etc will knife any ongoing connection, and we want to effectively ignore that case.

@kegsay
Copy link
Member

kegsay commented Sep 23, 2016

Is this sensible? Should we emit an event to indicate we may have lost a connection?

After much musing, I guess it's probably fine. AFAIK clients have no real reason to know about this state, so you should not emit an event to say that you might have lost the connection. If it turns out we need it in the future we can add it then.

Knee jerk reaction was no because it decouples when the ERROR state is triggered (no longer always on a /sync failure) but it is desirable to effectively smooth over errors (much like we do when sending messages).

LGTM

@kegsay
Copy link
Member

kegsay commented Sep 23, 2016

LGTM!

@dbkr
Copy link
Member

dbkr commented Oct 6, 2016

I'm backing this out because this will cause the client to sit around for another 1 minute and 50 seconds waiting for a connection to time out, without displaying an error message if the sync it triggers goes into the void. I suspect this is causing element-hq/element-web#2425

@t3chguy t3chguy deleted the erikj/sync_fail_first branch May 10, 2022 14:01
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.

3 participants