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: wait for all jobs to be completed before running AfterImportJob #3992

Merged
merged 8 commits into from
Oct 26, 2023

Conversation

Tofandel
Copy link
Contributor

@Tofandel Tofandel commented Sep 8, 2023

fixes #3560

By storing a list of ids in the cache when creating the jobs, that we delete one by one when the job completes, we retry the AfterImportJob every 60 seconds and check that all jobs have completed

  • Checked the codebase to ensure that your feature doesn't already exist.
  • Take note of the contributing guidelines.
  • Checked the pull requests to ensure that another person hasn't already submitted a fix.
  • Added tests to ensure against regression.
  • Updated the changelog

@Tofandel

This comment was marked as resolved.

@@ -84,7 +83,8 @@ public function read(WithChunkReading $import, Reader $reader, TemporaryFile $te
$afterImportJob = new AfterImportJob($import, $reader);

if ($import instanceof ShouldQueueWithoutChain) {
$jobs->push($afterImportJob->delay($delayCleanup));
$afterImportJob->setDependencies($jobs);
$jobs->push($afterImportJob->delay(60));
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove the $delayCleanup? I think it should be changeable from userland

Copy link
Contributor Author

@Tofandel Tofandel Sep 25, 2023

Choose a reason for hiding this comment

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

Because it was just added as an undocumented workaround to run the cleanup only after 100 minutes (which is an assumption on when all jobs should have finished), with this PR, which fixes the underlying issue it becomes unnecessary and would actually interfer with the fix if people forget to remove it, so if we leave the option to change the interval, it should be a differently named option, but I simply don't think it's necessary anymore

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah...

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should give it another name so it can be changed instead of a constant delay of 60

@patrickbrouwers patrickbrouwers merged commit 6f0da5d into SpartnerNL:3.1 Oct 26, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: File gets deleted after first chunk while using ShouldQueueWithoutChain
3 participants