-
-
Notifications
You must be signed in to change notification settings - Fork 352
fix: connect backoff mechanism #1354
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
860074e
to
dae86db
Compare
a0ec518
to
921b22f
Compare
@supabase/dashbit it would be very useful to get some feedback from your side on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @filipecabaco!
I looked at the counter modules, I have two notes:
-
I noticed you use
:erlang.phash2/1
:
id = :erlang.phash2(term)
This function isn't the best at generating unique values. It has 2^32 possible return values, which is relatively low for hashing. A typical usage of phash would be to deterministically assign value to a partition (in fact,phash2
accepts a second argument N, to cap the range). It is fair to expect collisions are very much possible.What you could do is lookup by
phash2
, but handle a case where there are multiple results and filter those based on the exact keys. That said, as long as you use simple terms (I see you use a tuple with two atoms and id), it's most likely fine to not hash altogether. -
Is there any reason
GenCounter
starts a process? It seems to me you only really use the registry to store and lookup keys, but not the process itself. If that's the case, what you actually want is to store the counters in an ETS table (which is exactly what Registry uses under the hood).
271eb6e
to
7a96230
Compare
Simple mechanism to prevent to many Connect processes from trying to startup in the same node.
055e35d
to
2df9787
Compare
565e79f
to
220b379
Compare
220b379
to
228e4d1
Compare
🎉 This PR is included in version 2.34.54 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What kind of change does this PR introduce?
Simple mechanism to prevent to many Connect processes from trying to startup in the same node.