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

Set correct default webhook batch size #25529

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sgress454
Copy link
Contributor

@sgress454 sgress454 commented Jan 16, 2025

This PR fixes the default webhook host batch size to align with the documentation, which states that:

A value of 0 means no batching (default: 0).

Currently we're explicitly setting the batch size to len(hosts) i.e. "send a batch with all host IDs". This PR sets the batch size to 1 if it's set to 0 in the config, which results in one webhook request at a time.

Note that with this change, there's no consistent way to return to the previous behavior of "send all host IDs" other than just setting a very high number for host-batch-size in the config. One option would be to interpret host-batch-size: -1 as "send all".

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.59%. Comparing base (a4d501e) to head (33b3e69).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25529      +/-   ##
==========================================
- Coverage   63.59%   63.59%   -0.01%     
==========================================
  Files        1619     1619              
  Lines      154987   154987              
  Branches     3949     3949              
==========================================
- Hits        98563    98559       -4     
- Misses      48656    48659       +3     
- Partials     7768     7769       +1     
Flag Coverage Δ
backend 64.44% <100.00%> (-0.01%) ⬇️

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.

@lucasmrod
Copy link
Member

Note that with this change, there's no consistent way to return to the previous behavior of "send all host IDs" other than just setting a very high number for host-batch-size in the config. One option would be to interpret host-batch-size: -1 as "send all".

I wonder if this is a breaking change and we should instead fix the documentation.
Customers that haven't configured host_batch_size will now see multiple requests instead of one.
If we are a-ok with the breaking change, let's add it to the changelog.

Copy link
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM. Pending changes/ file with a note on the breaking change.

@sgress454
Copy link
Contributor Author

I wonder if this is a breaking change and we should instead fix the documentation.
Customers that haven't configured host_batch_size will now see multiple requests instead of one.
If we are a-ok with the breaking change, let's add it to the changelog.

Yeah I had the same thought this morning -- this may be unexpected but it's the reality on the ground right now, and would definitely have impact on deployments w/ large # of hosts and the default setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants