Automattic / Automattic/kue

queue.shutdown allows jobs to both fail and complete simoultaneously.

Open
#1,068 2 comments 0 reactions 0 assignees View on GitHub
need more info unknown
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

I'm trying to get gracefull shutdown to work in a distributed setting and I am having the issue that when using `queue.shutdown` with a `timeout` value.
The job will both complete normally (`done` gets called) and it will fail with a `Shutdown` message.
Is this a bug or have i misinterpreted:
> Workers will wait timeout milliseconds for their active job's done to be called or mark the active job failed with shutdown error reason

From the documentation it reads as the job will either complete normally or be failed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing queue.shutdown(timeout) with distributed workers and record whether done is called before the Shutdown failure. Compare the observed behavior with the quoted documentation; simultaneous completion and failure would confirm the reported bug.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.