-
Notifications
You must be signed in to change notification settings - Fork 662
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
socket-mode 1.x: explicit server disconnect during 'connecting' state intermittently not handled #1787
Comments
This is a tricky issue to handle, because the 1.x line of socket-mode's architecture is such that there is a single state machine to handle transitions, but potentially, during a reconnect, two WebSocket connections are briefly active/overlapping as a connection is re-established. The underlying problem is, during this reconnect when we have two WS connections open, each WebSocket connection pumps events into the single state machine, causing unexpected state transitions. Consider the case where, at more or less the same time, one WS connection sends a "disconnect" event to the state machine and another sends a "open" or "connected" event. The single state machine will get confused. This issue is resolved in socket-mode 2.x, as the architecture has completely changed. Socket-mode 2.0 is available in bolt 4.0.0 rc1, and has been used successfully by some customers who have adopted it early. |
We recently stumbled upon this issue on multiple projects and here are the debug logs for the typical occurrence.
|
The first log is a big clue:
This is not a good sign, and may actually point to an issue in the Slack backend; under the hood, socket-mode sends |
Hi @filmaj do you have a plan to release the stable 4.x version? I want to determine whether we upgrade to rc1 or wait the stable version. |
@weijiany do you mean a bolt-js v4 release? We have started to put together plans for it but there is no specific timeline. If this issue is affecting you, I recommend trying the v4 rc. |
With debug logging it shows:
Originally posted by @MadrMan in #1654 (comment)
Any PR to address this should target the
socket-mode-1.x
branch as this would be a 'maintenance' fix for the now-outdated 1.x line of socket-mode.The text was updated successfully, but these errors were encountered: