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): Separate execution startedAt from createdAt #10810

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Sep 13, 2024

Summary

This PR introduces the column execution_entity.createdAt to differentiate between the time an execution is created in the DB and when processing begins, i.e. execution_entity.startedAt.

To test manually:

  • In regular mode, set N8N_CONCURRENCY_PRODUCTION_LIMIT=1 in regular mode and activate a workflow with a cron and a wait. The createdAt and startedAt timestamps should differ.
  • In scaling mode, start a main but not a worker and activate the above workflow to see all queued. Then start a worker and check the timestamps after execution completion.

As for unit tests, this change should be tested at ActiveExecutions.add and JobProcessor.processJob but those methods need heavy simplifying first, so I'm marking this as tests-needed. Let me know otherwise.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/PAY-1815

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)

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Sep 13, 2024
@ivov ivov added the tests-needed This PR needs additional tests label Sep 13, 2024
@ivov ivov marked this pull request as ready for review September 26, 2024 09:38
@ivov ivov requested a review from a team as a code owner September 26, 2024 09:38
Copy link

cypress bot commented Sep 27, 2024

n8n    Run #7074

Run Properties:  status check passed Passed #7074  •  git commit c505938435: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review pay-1815-execution-duration-includes-time-spent-waiting-for-pickup-in
Run status status check passed Passed #7074
Run duration 04m 13s
Commit git commit c505938435: 🌳 🖥️ 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 433
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov requested a review from netroy September 27, 2024 11:09
Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov merged commit afda049 into master Sep 27, 2024
66 checks passed
@ivov ivov deleted the pay-1815-execution-duration-includes-time-spent-waiting-for-pickup-in branch September 27, 2024 11:32
MiloradFilipovic added a commit that referenced this pull request Sep 30, 2024
* master:
  feat(Iterable Node): Add support for EDC and USDC selection (#10908)
  test(Schedule Trigger Node): Add tests and extract trigger test helper (no-changelog) (#10625)
  fix(Todoist Node): Fix listSearch filter bug in Todoist Node (#10989)
  fix(AwsS3 Node): Fix search only using first input parameters (#10998)
  fix(editor): Fix bug causing node issues to not be assigned before first interaction (no-changelog) (#10980)
  fix(editor): Allow resources to move between personal and team projects (#10683)
  fix(Respond to Webhook Node): Node does not work with Wait node (#10992)
  fix(core): Upgrade @n8n/typeorm to address a rare mutex release issue (#10993)
  refactor(core): Separate execution `startedAt` from `createdAt` (#10810)
  refactor(core): Make all pubsub messages type-safe (#10990)
  feat(Question and Answer Chain Node): Customize question and answer system prompt (#10385)
  fix(editor): Fix performance issue in credentials list (#10988)
  fix(RSS Feed Trigger Node): Fix regression on missing timestamps (#10991)
  fix(editor): Fix workflow executions list page redirection (#10981)
  fix(editor): Fix filter execution by "Queued" (#10987)
  fix(API): Fix workflow project transfer (#10651)
@janober
Copy link
Member

janober commented Oct 2, 2024

Got released with n8n@1.62.1

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 tests-needed This PR needs additional tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants