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

refactor(core): Remove crash recovery from error executions (no-changelog) #9551

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented May 30, 2024

Crash recovery amends an execution using event logs and then runs post-execution hooks. This recovery is only intended for an execution truncated by an instance crash, is only performed by a main process (i.e. no crash recovery for production executions in queue mode), and is being triggered...

  • by the EventBus during server startup, and
  • on WorkflowRunner.processError, which is called from two catch clauses in WorkflowRunner.runMainProcess (main mode) and from three catch clauses in WorkflowRunner.enqueueExecution (queue mode).

If an execution has reached WorkflowRunner.processError, then we know the execution has failed, i.e. it finished with an error status, rather than being truncated by an instance crash. A failed execution already has the data that is populated by the crash recovery mechanism:

  • executionData.resultData.runData,
  • executionData.resultData.error,
  • status, and
  • stoppedAt.

Hence there should be no use in crash recovery for error executions.

Follow-up to: #9512

@ivov
Copy link
Contributor Author

ivov commented May 30, 2024

@krynble to confirm

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels May 30, 2024
Copy link
Contributor

@krynble krynble 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 removing this dead code.

Looking at this code now it does not make sense, but at the time we still had own mode, which ran in a separate process.

In case of a failure on the child process, it would simply exit and would invoke the call to processError which could then restore the execution if it failed.

This does not make sense anymore since own mode was removed, so all executions reaching this point should be due to an actual execution error, as crashes are now handled elsewhere.

Copy link
Contributor

github-actions bot commented Jun 3, 2024

✅ No visual regressions found.

Copy link

cypress bot commented Jun 3, 2024

2 flaky tests on run #5276 ↗︎

0 359 0 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project: n8n Commit: 0212a9869c
Status: Passed Duration: 04:48 💡
Started: Jun 3, 2024 12:03 PM Ended: Jun 3, 2024 12:07 PM
Flakiness  5-ndv.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Screenshots Video
Flakiness  24-ndv-paired-item.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > resolves expression with default item when input node is not parent, while still pairing items Test Replay Screenshots Video

Review all test suite changes for PR #9551 ↗︎

Copy link
Contributor

github-actions bot commented Jun 3, 2024

✅ All Cypress E2E specs passed

@ivov ivov merged commit 4858384 into master Jun 3, 2024
30 of 32 checks passed
@ivov ivov deleted the remove-crash-recovery-from-error-executions branch June 3, 2024 12:35
@janober
Copy link
Member

janober commented Jun 5, 2024

Got released with n8n@1.45.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