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

No longer rely on caller_runs for backpressure in sqs active job executor #124

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

alextwoods
Copy link
Contributor

Changes the fallback_policy on the executor to :abort instead of using caller_runs. This will raise an Concurrent::RejectedExecutionError when posting to the executor when it does not have capacity. It then uses a Concurrent:Event to block the calling thread until the next task completes.

Issue #, if available:
Fixes #123

Description of changes:

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

Copy link
Contributor

@mullermp mullermp left a comment

Choose a reason for hiding this comment

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

Needs a test I think.

lib/aws/rails/sqs_active_job/executor.rb Show resolved Hide resolved
@alextwoods alextwoods merged commit 62c99c0 into main Jun 6, 2024
36 of 37 checks passed
@alextwoods alextwoods deleted the backpressure branch June 6, 2024 15:50
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.

Clean shutdown procedure is not invoked when the main thread participates in thread pool execution
2 participants