Skip to content

fix(networking): bound in-flight retrying requests in distributed_service - #26263

Draft
samvallad33 wants to merge 1 commit into
vectordotdev:masterfrom
samvallad33:fix/vector-es-oom
Draft

fix(networking): bound in-flight retrying requests in distributed_service#26263
samvallad33 wants to merge 1 commit into
vectordotdev:masterfrom
samvallad33:fix/vector-es-oom

Conversation

@samvallad33

@samvallad33 samvallad33 commented Aug 29, 2026

Copy link
Copy Markdown

Closes #25212.

The single-service path and the distributed-service path put the concurrency limit on opposite sides of retry, and only one of them creates backpressure. On the single path the limit sits outside retry. A request holds its permit for the whole retry sequence, including every backoff, so when permits run out the service stops accepting work and backpressure reaches the source.

The distributed path has no limit outside retry at all. Its only limit is the per-endpoint AdaptiveConcurrencyLimit, which sits inside retry, and that permit is released as soon as one attempt resolves. So nothing is counting a request that is parked between attempts. The caller keeps seeing a ready service, keeps handing over batches, and retrying futures pile up with no ceiling.

This adds a bound outside retry on the distributed path, so a request in backoff still holds a slot. Both paths now behave the same way under sustained failure.

…vice

The single service path puts the concurrency limit outside retry, so a
request holds its permit across every attempt and every backoff sleep and
poll_ready goes pending once the permits are gone. distributed_service has
no limit outside retry. Its only limiter is the per endpoint
AdaptiveConcurrencyLimit, which sits inside retry and drops its permit as
soon as one attempt resolves, so nothing counts a request that is parked
between attempts. During a sustained failure the caller keeps seeing a
ready service and retrying requests accumulate without bound.

Add a ConcurrencyLimit between the rate limit and the retry, sized at the
per endpoint concurrency ceiling times the number of endpoints. That is the
most the inner limiters can ever admit at once, so it cannot become the
binding constraint on a healthy pipeline.

Add a backpressure test module that counts how many requests the service
accepts before poll_ready stops returning ready. Against a sustained 429,
which the Elasticsearch retry logic retries forever and the health logic
never classifies, the service admitted 500 requests before this change,
which was the harness cap rather than a settling point.
@github-actions github-actions Bot added the domain: sinks Anything related to the Vector's sinks label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, please sign our Contributor License Agreement.

To sign, copy and post the phrase below as a new comment on this PR.

Note: If the bot says your username was not found, the email used in your git commit may not be linked to your GitHub account. Fix this at github.com/settings/emails, then comment recheck to retry.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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

Labels

domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(elasticsearch sink): Unbounded in-flight retrying batches cause OOM during sustained downstream failures

1 participant