-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
fix: on new keys, disconnect user socket #1292
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
2be2cc9
to
5463a7e
Compare
427b81e
to
f0766b0
Compare
hey @supabase/dashbit 👋 we're looking for a way to:
with the approach of this PR (which I was unable to test properly the socket shutdown) we would potentially have two issues:
how could we go around this issue? my current potential approaches are:
Or would I be able to achieve the same using the socket Thank you for your help. |
The socket However, I must say that you have conflicting goals too:
If the mailbox is full, you will either have to wait for long, so the client receives the last message, or terminate early without delivering the messages. So it depends on what you want to prioritize. You could also consider having two modes:
What do you think? How would you like to proceed? |
Since this is a security focused feature Hard shutdown is the more appropriate route so potentially having a Registry to track socket processes to then Informative elements are important but by sacrificing security 😅. Also great idea of using Registry, I always forget that they exist as a tool to be used for such scenarios... Having a GenServer would be doing the same but without a proper API to comply to and badly optmised 🤦 Will try that in this PR, thank you for the feedback🙏 |
So the overall design would be to have a separate process that listens to pubsub and receives a cluster broadcast "disconnect all processes". Then it goes to the registry and sends an exit everybody. Given this process will run on each node in the cluster, you then get a cluster wise disconnect. However, I'd say the existing "disconnect" may be fine too, except if you are looking for an explicit mechanism to shutdown bad actors that are flooding the system. |
What kind of change does this PR introduce?
on new keys, disconnect user socket