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

Improve worker pool reservation to avoid starvation #36

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

jnadler
Copy link
Contributor

@jnadler jnadler commented Mar 1, 2022

During Elasticsearch indexing, when a batch indexing error occurs we retry with exponential backoff. The worker pool checkout/checkin was managed outside of the block with the backoff sleep(). This caused a condition where if lots of bad documents are arriving and causing batch errors, lots of workers will be unavailable because they are doing backoff sleeps, and worker pool exhaustion is likely.

This change attempts to address that by moving the worker pool checkout/checkin closer to the batch indexing API invocation, which is appropriate as the worker pool is intended to bound the concurrency that Elasticsearch sees.

@jnadler jnadler merged commit 2e182d4 into master Mar 1, 2022
@jnadler jnadler deleted the reduce-retry-worker-starvation branch March 1, 2022 16:31
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.

None yet

2 participants