Skip to content

Conversation

@magnetised
Copy link
Contributor

ATM if you re-enable consumer suspend you don't gain much because existing, hibernated, consumers don't get the message (literally).

This ConsumerRegistry.enable_suspend/3 function is a single shot config plus consumer wake up call that we can use to sucessfully toggle suspension, mitigating the thundering herd effect.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.35%. Comparing base (d469344) to head (e91f567).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3548      +/-   ##
==========================================
+ Coverage   75.20%   75.35%   +0.14%     
==========================================
  Files          51       51              
  Lines        2743     2743              
  Branches      404      404              
==========================================
+ Hits         2063     2067       +4     
+ Misses        678      674       -4     
  Partials        2        2              
Flag Coverage Δ
electric-telemetry 22.71% <ø> (ø)
elixir 57.74% <ø> (+0.35%) ⬆️
elixir-client 74.47% <ø> (+0.52%) ⬆️
packages/experimental 87.73% <ø> (ø)
packages/react-hooks 86.48% <ø> (ø)
packages/typescript-client 93.07% <ø> (ø)
packages/y-electric 55.12% <ø> (ø)
typescript 87.45% <ø> (ø)
unit-tests 75.35% <ø> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@robacourt robacourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just left a little nit

disabled, because the configuration message will have the side-effect of
waking all consumers from hibernation.
The `max_timeout` value allows for spreading the suspension of existing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit confusing calling this a timeout, sure it's how it's implemented, but from an API perspective it's a max_stagger_delay and you'd probably do something like hibernate_after + Enum.random(0..max_stagger_delay)

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

Successfully merging this pull request may close these issues.

3 participants