Skip to content

RQ_DEFAULT_TIMEOUT doesn't work with Redis Sentinel #11168

@ymasson

Description

@ymasson

NetBox version

v3.3.9

Python version

3.9

Steps to Reproduce

  1. Configure Netbox to use a Redis Sentinel cluster
  2. Add RQ_DEFAULT_TIMEOUT=300 in configuration.py
  3. Run a report with a time.sleep(310) in the code (simulate long run)

logs are

 File "/opt/netbox/venv/lib/python3.9/site-packages/rq/timeouts.py", line 61, in handle_death_penalty
 raise self._exception('Task exceeded maximum timeout value 'rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (180 seconds)

Expected Behavior

the RQ_DEFAULT_TIMEOUT parameter should be used for Redis Sentinel as the same way of Redis.

180s seems to be the default value of Python RQ.
https://github.com/rq/rq/blob/0691b4d46eb721b5fb5395a03fd770db7e1651f4/rq/queue.py#L41

Observed Behavior

the RQ_PARAMS in

RQ_PARAMS = {
doesn't have 'DEFAULT_TIMEOUT': RQ_DEFAULT_TIMEOUT, for the Redis Sentinel case.

I successfully tested to add that parameter in RQ_PARAMS.
The logs became

File "/opt/netbox/venv/lib/python3.9/site-packages/rq/timeouts.py", line 61, in handle_death_penalty
 raise self._exception('Task exceeded maximum timeout value 'rq.timeouts.JobTimeoutException: Task exceeded maximum timeout value (300 seconds)

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions