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): Prevent shutdown error in regular mode #10844

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Sep 17, 2024

Dynamically import WorkerServer to prevent ScalingService from being registered in the DI container when running a main in regular mode.

ComponentShutdownError: Failed to shutdown gracefully
    at ShutdownService.shutdownComponent (/Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:113:29)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:99:41
    at async Promise.allSettled (index 0)
    at ShutdownService.startShutdown (/Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:98:4)
    at ShutdownService.waitForShutdown (/Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:88:3)
    at /Users/ivov/Development/n8n/packages/cli/src/commands/base-command.ts:329:4 {
  level: 'error',
  tags: { packageName: 'cli' },
  extra: { component: 'ScalingService.stop()' },
  [cause]: TypeError: Cannot read properties of undefined (reading 'pause')
      at ScalingService.stop (/Users/ivov/Development/n8n/packages/cli/src/scaling/scaling.service.ts:91:20)
      at ShutdownService.shutdownComponent (/Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:110:17)
      at /Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:99:52
      at Array.map (<anonymous>)
      at ShutdownService.startShutdown (/Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:99:18)
      at ShutdownService.shutdown (/Users/ivov/Development/n8n/packages/cli/src/shutdown/shutdown.service.ts:79:31)
      at /Users/ivov/Development/n8n/packages/cli/src/commands/base-command.ts:327:25
      at ReadStream.<anonymous> (/Users/ivov/Development/n8n/packages/cli/src/commands/start.ts:335:45)
      at ReadStream.emit (node:events:519:28)
      at ReadStream.emit (node:domain:488:12)
} { component: 'ScalingService.stop()' }

@ivov ivov changed the title fix(core): Prevent shutdown error fix(core): Prevent shutdown error in regular mode Sep 17, 2024
Copy link

cypress bot commented Sep 17, 2024

n8n    Run #6901

Run Properties:  status check passed Passed #6901  •  git commit b8c27cf5d2: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review prevent-shutdown-error
Run status status check passed Passed #6901
Run duration 04m 38s
Commit git commit b8c27cf5d2: 🌳 🖥️ 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 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 430
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Sep 17, 2024
@ivov ivov merged commit acb4194 into master Sep 17, 2024
35 checks passed
@ivov ivov deleted the prevent-shutdown-error branch September 17, 2024 10:02
MiloradFilipovic added a commit that referenced this pull request Sep 17, 2024
* master:
  ci: Setup biome and pre-commit hooks for formatting (no-changelog) (#10795)
  feat(editor): Add truncate directive (#10842)
  fix(editor): Allow custom git repo urls in source control settings (#10849)
  fix(Invoice Ninja Node): Fix lint error (no-changelog) (#10848)
  fix(editor): Minimap Show nodes outside viewport (#10843)
  fix(core): Prevent shutdown error in regular mode (#10844)
  feat(Invoice Ninja Node): Add actions for bank transactions (#10389)
  fix(editor): Address edge toolbar rendering glitches (#10839)
@github-actions github-actions bot mentioned this pull request Sep 18, 2024
@janober
Copy link
Member

janober commented Sep 18, 2024

Got released with n8n@1.60.0

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.

3 participants