yiisoft / yiisoft/yii2-queue

Add support for extending TTR

Open
#250 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:enhancement
Dominant language
PHP
Stars
1.1k
Forks
285
Avg merge
5d 3h
Merged PRs (30d)
2

Description

TTR is a mechanic to release crashed / stalled jobs back into the queue.
Sometimes jobs are slow but not stalled.
Consider the DownloadJob from the docs; I could easily make this job exceed its TTR by throttling the connection at the server.
However since the process is alive and actually doing what it is supposed to do (assuming it is still actually receiving more than 0 b/s) we might want to tell the queue that we're still busy and it shouldn't release our job to someone else just yet.

Beanstalk protocol uses touch for this, and this shouldn't be hard to implement for other drivers.
The database driver currently doesn't do TTR at all (#249). When it does, all we need to do to extend the time is update the reserved_at field.
For other drivers I'm not sure how to implement this exactly, but I don't think it'll be hard.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the DownloadJob example in the documentation and inspecting the queue driver implementations. Compare Beanstalk's touch behavior with the database driver's reserved_at approach and determine how the other drivers should extend TTR. Done means an extension mechanism works consistently across supported drivers without releasing an active job.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.