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

Provide a way to close the active websocket connections #10119

Open
codingkarthik opened this issue Jan 29, 2024 · 0 comments
Open

Provide a way to close the active websocket connections #10119

codingkarthik opened this issue Jan 29, 2024 · 0 comments
Labels
k/enhancement New feature or improve an existing feature

Comments

@codingkarthik
Copy link
Contributor

codingkarthik commented Jan 29, 2024

Is your proposal related to a problem?

Currently, if metadata is reloaded, the active websocket connections are dropped and the consumers of the websocket connections are expected to reconnect to the graphql-engine. The websocket connections of the active subscriptions are dropped because the state of the metadata might have been updated and if the connections are not closed, then the subscriptions will still be running on the previous state of metadata.

The problem with the above is that while reloading metadata, the websocket connections are closed and then the clients re-open the connections, this leads to a huge spike in the number of postgres connections because the older websocket connection's postgres connections would not have been dropped and the new websocket connections will acquire new postgres connections. So, this means that there will be a temporary spike of postgres connections until the older connections are dropped.

Also, while this happens, a customer has noticed that the number of connections defined by HASURA_GRAPHQL_PG_CONNECTIONS and HASURA_GRAPHQL_CONNECTIONS_PER_READ_REPLICA are exceeded. Internal ticket Ref: https://hasurahelp.zendesk.com/agent/tickets/9743

Describe the solution you'd like

Provide an API to manually drop the active websocket connections instead of dropping the websocket connections on every metadata reload (this can be done by disabling https://hasura.io/docs/latest/deployment/graphql-engine-flags/reference/#close-websocket-connections-on-metadata-change), so the customer will have the choice when to close the active websocket connections.

Describe alternatives you've considered

@codingkarthik codingkarthik added the k/enhancement New feature or improve an existing feature label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant