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

fix(core): Account for waiting jobs during shutdown #11338

Merged
merged 2 commits into from
Oct 22, 2024
Merged

fix(core): Account for waiting jobs during shutdown #11338

merged 2 commits into from
Oct 22, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Oct 22, 2024

@@ -126,13 +126,23 @@ export class ScalingService {

@OnShutdown(HIGHEST_SHUTDOWN_PRIORITY)
async stop() {
await this.queue.pause(true, true); // no more jobs will be picked up
const { instanceType } = this.instanceSettings;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original issue was main waiting forever on waiting (not running) executions when there were no workers available during the 30s grace period during shutdown. The deeper issue was that main should not be waiting at all for already enqueued jobs during the grace period, i.e. we need to divide responsibilities during shutdown based on instance type.

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Oct 22, 2024
packages/cli/src/active-executions.ts Outdated Show resolved Hide resolved
packages/cli/src/active-executions.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@tomi tomi left a comment

Choose a reason for hiding this comment

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

Can't really reason what all the implications of this change might be, but at least it should make the shutdown work better 👍

Copy link

cypress bot commented Oct 22, 2024

n8n    Run #7498

Run Properties:  status check passed Passed #7498  •  git commit 71c670d518: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review pay-2129
Run status status check passed Passed #7498
Run duration 04m 28s
Commit git commit 71c670d518: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Committer Iván Ovejero
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
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 458
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov merged commit c863abd into master Oct 22, 2024
76 of 77 checks passed
@ivov ivov deleted the pay-2129 branch October 22, 2024 15:11
@github-actions github-actions bot mentioned this pull request Oct 24, 2024
@janober
Copy link
Member

janober commented Oct 24, 2024

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants