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

Reconnection issue in hypha rpc #554

Open
oeway opened this issue Feb 11, 2024 · 0 comments
Open

Reconnection issue in hypha rpc #554

oeway opened this issue Feb 11, 2024 · 0 comments

Comments

@oeway
Copy link
Contributor

oeway commented Feb 11, 2024

The current implementation of hypha rpc cannot handle re-connection properly after disconnected from the server.

Here, we need to have a mechanism to restore connection after disconnecting from the server. Here is a list of points to be considered:

  • After the initial connection, the client will request for a reconnection_token, and refresh it on a fixed interval
  • The client should keep trying to reconnect if still not able to connect until it recovers
  • If the server detected a lost of connection for a given client, it need to pause the communication for the client (i.e. any new function call to that client should be immediately rejected), also if the user launched browser apps for example, those clients should remain and removed until timeout
  • If the server get a previously connected client (connected using the reconnection_token), the server should restore the previous session. If the reconnection_token expires, the server should reject the client.

For reference, this is the server implementation: https://github.com/amun-ai/hypha/blob/main/hypha/websocket.py
(to properly handle the reconnection, we might need to update the logic here too)

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

No branches or pull requests

1 participant