-
Notifications
You must be signed in to change notification settings - Fork 404
fix(mercury): gracefully handle mercury rebalancing #5106
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
Changes from 1 commit
8e0f835
a9a8559
9c0d114
a2edad1
56582c3
63518ca
5c9472e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -901,9 +901,18 @@ const Mercury = WebexPlugin.extend({ | |
| break; | ||
| case 4000: | ||
| // metric: disconnect | ||
| this.logger.info(`${this.namespace}: socket ${sessionId} replaced; will not reconnect`); | ||
| if (isActiveSocket) this._emit(sessionId, 'offline.replaced', event); | ||
| // If not active, nothing to do | ||
| if (reason === 'replaced') { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: The comparison reason === 'replaced' is case-sensitive. If there's any chance the server could send 'Replaced' or 'REPLACED', a safer check would be:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, its already there at declaration const reason = event.reason && event.reason.toLowerCase(); |
||
| this.logger.info(`${this.namespace}: socket ${sessionId} replaced; will not reconnect`); | ||
| if (isActiveSocket) this._emit(sessionId, 'offline.replaced', event); | ||
| } else { | ||
| this.logger.info( | ||
| `${this.namespace}: socket ${sessionId} disconnected with 4000: ${event.reason}; reconnecting` | ||
| ); | ||
| if (isActiveSocket) { | ||
| this._emit(sessionId, 'offline.transient', event); | ||
| this._reconnect(socketUrl, sessionId); | ||
| } | ||
| } | ||
| break; | ||
| case 4001: | ||
| // replaced during shutdown | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.