Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RQ_DEFAULT_TIMEOUT doesn't work with Redis Sentinel #11168

Closed
ymasson opened this issue Dec 13, 2022 · 2 comments
Closed

RQ_DEFAULT_TIMEOUT doesn't work with Redis Sentinel #11168

ymasson opened this issue Dec 13, 2022 · 2 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@ymasson
Copy link

ymasson commented Dec 13, 2022

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)
@ymasson ymasson added the type: bug A confirmed report of unexpected behavior in the application label Dec 13, 2022
@ymasson
Copy link
Author

ymasson commented Dec 13, 2022

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

@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Dec 13, 2022
@jeremystretch jeremystretch self-assigned this Dec 13, 2022
@ymasson
Copy link
Author

ymasson commented Dec 14, 2022

Thanks @jeremystretch

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants