Skip to content

feat(logging): report failed enqueues, handler failures and retries that will not happen - #3

Merged
Mikhus merged 1 commit into
masterfrom
logging
Aug 20, 2026
Merged

feat(logging): report failed enqueues, handler failures and retries that will not happen#3
Mikhus merged 1 commit into
masterfrom
logging

Conversation

@creomobile

@creomobile creomobile commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes a lost or silently un-retried job visible. push() is fire-and-forget, so a job which never reached Redis used to leave no trace on either side.

[JobQueue] push error: — the existing marker text, unchanged — now also covers a write rejected after push() returned, which the underlying queue reports through an error handler only. It is written at error level and carries the queue name, the requested delay and ttl and a failure code. A failure the Redis client delivers twice, through both its command callback and its returned promise, still writes one line.

The handler-failure line now states what happens next — retry in <ms> or no retry — together with the message id, so a stalled retry loop can be told apart from a handler which gave up. Two more cases get their own line: a retry suppressed because the job's ttl had expired, and a re-schedule whose write to Redis failed, which means the retry the previous line promised is not coming.

A failure reason is never taken from the error as it is: only an allow-listed code is printed — a framework IMQ_… code, a system E… code, a small integer, a known Redis reply code or a known Redis-client failure message mapped to a code of our own; everything else becomes unknown. The job body is never logged, and a logger which throws cannot influence the queue — including that it no longer cancels a re-schedule, which is the one deliberate behavioural difference.

No control flow, return value, retry decision or timer was changed otherwise.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / internal
  • Other:

Checklist

  • I have read the Contributing guide.
  • Tests added or updated, and the full suite passes locally (npm test).
  • Docs / doc-blocks updated where relevant.
  • The PR is focused on a single logical change.

Contribution terms (required)

  • I have read and agree to the @imqueue Contribution Terms.
    I grant the project owner the right to license my contribution
    commercially, royalty-free, my contribution stays available under
    GPL-3.0, I keep my copyright, and I understand I will receive no fee for
    it. If I did not agree, I would not be submitting this contribution.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the @imqueue Contribution Terms. ✅
Posted by the CLA Assistant Lite bot.

@creomobile
creomobile requested a review from Mikhus August 19, 2026 19:11
@creomobile creomobile changed the title feat: add detailed logging for job enqueue and handling failures feat(logging): report failed enqueues, handler failures and retries that will not happen Aug 19, 2026
@creomobile

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Aug 19, 2026
@Mikhus
Mikhus merged commit 037ff0e into master Aug 20, 2026
8 of 16 checks passed
@Mikhus
Mikhus deleted the logging branch August 20, 2026 13:31
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants