-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Server-side: handle reconnection to different server #5562
Comments
Yes, this is correct. In fact there are a wide range of cases where recovery behavior is needed (e.g., server goes down and user needs to be transferred to a different server within the load balancing group). We've been considering these scenarios in detail. However I don't think we have a tracking issue for them yet, so I'm going to change the issue title for this one and use it as the tracking issue. |
Note that the expected solution for this is going to involve the app developer making their per-user state serializable so that it's transferrable between servers and doesn't have to be kept live in the server's memory forever. When a user disconnects, we don't know if that's because they are finished, or if it's because there was a network issue and they will attempt to reconnect and resume shortly. So the server doesn't know to keep their state in memory, and even if it does, that wouldn't guarantee the user reconnects to the same server. In summary, a robust solution will involve the app developer doing some work and accounting for it in their app architecture. We intend to provide patterns to make this straightforward and robust, but it will still require the app developer to be aware of them and fit in with those patterns. |
Our company would use server side Blazor for some of our internal tools if there was even simple reconnect support. That would only supports single server and keeping state in memory with timeout. |
Assuming that something similar to what is detailed below has already been drafted by the Blazor team internally, this is being submitted here just it in case it helps gets any extra thoughts moving about how the structure of a session control system could work. Essentially, I am proposing that a new API be created called It could also be structured similarly to Hope I could provide something useful. |
Perhaps I missed it, but is there at least a way to show the user, that he is disconnected from the server? Perhaps with the possibility to reload the page (with loosing the state)? |
Since #8177 has been closed and this issue is now in the backlog, if I want to start using Blazor, how should I prepare for this feature when it will be available? Because if the user state needs to be serializable, this must be a key decision during initial application design. My concern is that if I implement blazor right now, when this issue gets fixed it will be implemented in a way that is incompatible with whatever I came up with. How should one proceed? Load balancing is a very critical scenario for any decent sized application, so it's my primary concern |
An Business-level data is persisted directly to the We're hoping this type of implementation will make it easier to switch to whatever solution eventually becomes the official answer. Of course, having access to the Blazor client internals would allow such a system to explicitly identify "reconnect" versus "quit and restart" restoration behavior, but we apply an arbitrary expiration policy (ex. 5 minutes) to the startup state-restoration decision. I like most of the ideas from @TheFanatr but I'd rather see a new API have a name other than |
This is going to be addressed as part of #30344 |
If after a delay, or a lost network connection the websocket disconnects. It seems it will never reconnect.
The text was updated successfully, but these errors were encountered: