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

Issue 4032 queue run lease time #4322

Merged
merged 12 commits into from Aug 8, 2020

Conversation

kevin-dutra
Copy link
Contributor

Resolves #4032. Builds on #4083. This includes the work from @lems3 and @m4olivei.

I've resolved the merge issues due to more recent changes. I think there's value to separating out the queue lease time, so I've done that here also. As an example, let's say we're using the same value both time limit and queue lease and I know queue worker X takes 30s on average, so I use --time-limit=45 to be on the safe side.

On one run, it processes item A in 40s. There are still 5s left, so it claims item B, but item B is claimed with an expiry that's only 5s in the future and we know that it's very unlikely to complete within that time frame, leaving the possibility that Drupal will reset item B and a second worker will claim it while it's still being processed by the first worker.

By defaulting to an hour (which the QueueInterface says is the default) and allowing someone to specifically allocate the lease time, we can avoid this issue.

lems3 and others added 9 commits April 5, 2019 08:16
… of the queue instead of using the default of 60 minutes.
…nknown exception during queue processing
* master:
  Remove latest unstable chiclet. Its not helpful.
  Remove mentions of Shippable. (drush-ops#4079)
  Add mysql service to Travis config. (drush-ops#4078)
  Fix link in docs.
  More docs about dynamic users in site.yml files.
  Fix drush-ops#4055. Sort inside namespaces in list command. (drush-ops#4057)
  Print class name in drush_op()
  Update dependencies. (drush-ops#4051)
  UNISH_NO_TIMEOUTS is unused since we moved to CLITrait. (drush-ops#4047)
  Add jsonapi command (drush-ops#4045)
  Fixes drush-ops#4034: Ensure that status code is nonzero on invalid shutdown (drush-ops#4037)
  Add webflo/drupal-core-require-dev (drush-ops#4041)
  Fix TTY detection for runserver command. (drush-ops#4033)
  Add vagrant transport to Drush. (drush-ops#4036)
…run-lease-time

# Conflicts:
#	src/Drupal/Commands/core/QueueCommands.php
@weitzman
Copy link
Member

Hoping @juampynr, @damiankloip or @davereid can chime in here. Vaeguely recall you guys contributing to this command in the past.

@greg-1-anderson greg-1-anderson changed the base branch from master to 10.x August 2, 2020 22:59
@weitzman
Copy link
Member

weitzman commented Aug 8, 2020

Pity we couldn't get any reviews on this. I just added a bit of polish. I'll merge when it comes back green.

I don really follow the lease-time example in the OP but the code is simple to follow so in it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queue:run has a different behavior than the processQueues() section of Drupal cron.
4 participants