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

feat(core): Separate concurrency limits for production and evaluation executions (no-changelog) #12387

Merged

Conversation

burivuhster
Copy link
Contributor

Summary

This PR separates concurrency limits for evaluation-related executions (both workflow under test and evaluation workflow executions) from existing production concurrency limits.

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@burivuhster burivuhster force-pushed the ai-520-impact-of-test-executions-on-concurrency-limits branch from e467f5e to fc9be62 Compare December 27, 2024 15:40
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Dec 27, 2024
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 78.26087% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...cli/src/concurrency/concurrency-control.service.ts 81.39% 8 Missing ⚠️
packages/cli/src/concurrency/concurrency-queue.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@burivuhster burivuhster requested a review from ivov January 7, 2025 15:04
@burivuhster burivuhster marked this pull request as ready for review January 7, 2025 15:04
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Lovely work! A few comments, I'll come back later to test.

@@ -35,6 +35,12 @@ export const schema = {
default: -1,
env: 'N8N_CONCURRENCY_PRODUCTION_LIMIT',
},
evaluationLimit: {
doc: 'Max evaluation executions allowed to run concurrently.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add the other details as well? They all apply.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not sure about the queue mode here, as the concurrency control service is disabled when n8n is being run in 'queue' mode. Isn't some different way to limit concurrency applies in queue mode for workers?

Copy link
Contributor

Choose a reason for hiding this comment

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

In queue mode, concurrency control uses the exact same env but is delegated to Bull.

packages/cli/src/config/schema.ts Show resolved Hide resolved
@burivuhster burivuhster requested a review from ivov January 10, 2025 16:08
ivov
ivov previously approved these changes Jan 13, 2025
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Thanks for addressing everything! Code LGTM

*/
has(executionId: string) {
if (!this.isEnabled) return false;

return this.productionQueue.getAll().has(executionId);
return Array.from(this.queues.values()).some((queue) => queue.getAll().has(executionId));
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth optimizing this?

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Jan 13, 2025

n8n    Run #8739

Run Properties:  status check passed Passed #8739  •  git commit a5ee2408bc: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Project n8n
Branch Review ai-520-impact-of-test-executions-on-concurrency-limits
Run status status check passed Passed #8739
Run duration 04m 50s
Commit git commit a5ee2408bc: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Committer Eugene Molodkin
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 489
View all changes introduced in this branch ↗︎

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link
Contributor

✅ All Cypress E2E specs passed

@burivuhster burivuhster merged commit ce22f06 into master Jan 14, 2025
38 checks passed
@burivuhster burivuhster deleted the ai-520-impact-of-test-executions-on-concurrency-limits branch January 14, 2025 12:49
@janober
Copy link
Member

janober commented Jan 15, 2025

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants