-
-
Notifications
You must be signed in to change notification settings - Fork 748
If there’s no queue concurrency limit, default to the env concurrency limit #1687
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
Conversation
|
WalkthroughThis change updates the Lua script in the MarQS module to determine the concurrency limit more dynamically. The fallback value for the dequeueMessage command is now derived from an environment variable (envConcurrencyLimit) instead of a hardcoded constant. A minor formatting update was also applied to the return statement of the calculateQueueCurrentConcurrencies command. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant MarQS
participant Redis
Client->>MarQS: Call dequeueMessage()
MarQS->>Redis: GET concurrencyLimitKey
Redis-->>MarQS: Return value (or nil)
alt Value exists
MarQS->>MarQS: Set concurrencyLimit to returned value
else Nil value
MarQS->>MarQS: Set concurrencyLimit to envConcurrencyLimit
end
MarQS-->>Client: Return message with concurrency limit
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
apps/webapp/app/v3/marqs/index.server.tsOops! Something went wrong! :( ESLint: 8.45.0 ESLint couldn't find the config "custom" to extend from. Please check that the name of the config is correct. The config "custom" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (7)
🔇 Additional comments (3)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
When dequeuing a run we check that there's enough concurrency to execute it.
Concurrency limits exist at a few layers
concurrencyLimit
).If you didn't set
concurrencyLimit
on your task/custom queue then we previously defaulted it to 1M. This seemed reasonable, as you would be limited by the environment concurrency limit…But there's an edge case with
triggerAndWait
where you could accidentally spin up a lot of containers if you hadn't set aconcurrencyLimit
on the parent and a few other conditions were true. This is related to when we release the concurrency to make runs start as fast as possible for people.This change defaults the task/queue concurrencyLimit to the environment, if it's not set. This limits the amount of possible containers running to 2x the env concurrency limit.
Summary by CodeRabbit