RQ_DEFAULT_TIMEOUT doesn't work with Redis Sentinel #7348

Closed
opened 2025-12-29 20:22:11 +01:00 by adam · 2 comments
Owner

Originally created by @ymasson on GitHub (Dec 13, 2022).

Originally assigned to: @jeremystretch on GitHub.

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.
0691b4d46e/rq/queue.py (L41)

Observed Behavior

the RQ_PARAMS in 860805ba82/netbox/netbox/settings.py (L626) 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)
Originally created by @ymasson on GitHub (Dec 13, 2022). Originally assigned to: @jeremystretch on GitHub. ### 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 https://github.com/netbox-community/netbox/blob/860805ba8245f5d5a4401dca041b21678b55f060/netbox/netbox/settings.py#L626 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) ```
adam added the type: bugstatus: accepted labels 2025-12-29 20:22:11 +01:00
adam closed this issue 2025-12-29 20:22:11 +01:00
Author
Owner

@ymasson commented on GitHub (Dec 13, 2022):

If you want, I can create a Pull Request to add the 'DEFAULT_TIMEOUT' in the Redis Sentinel RQ_PARAMS section.

@ymasson commented on GitHub (Dec 13, 2022): If you want, I can create a Pull Request to add the 'DEFAULT_TIMEOUT' in the Redis Sentinel RQ_PARAMS section.
Author
Owner

@ymasson commented on GitHub (Dec 14, 2022):

Thanks @jeremystretch

@ymasson commented on GitHub (Dec 14, 2022): Thanks @jeremystretch
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7348