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

Dynamic Visibility Timeout #47

Open
pehrlich opened this issue Jan 24, 2018 · 3 comments · May be fixed by #62
Open

Dynamic Visibility Timeout #47

pehrlich opened this issue Jan 24, 2018 · 3 comments · May be fixed by #62

Comments

@pehrlich
Copy link

Hello,

With SQS it is possible to continually bump the visibility timeout whilst working on a task. This allows a short retry time, but the ability to have jobs of potentially long length, as long as the worker keeps updating the timeout. Will PyQS support this?

@andrewgross
Copy link
Collaborator

Hmm good question. Not something I had original thought about adding. I think it could be done as long as we have a way to ensure that the worker is still alive and processing, then the manager could bump the timeout continuously. We could also try threads on the worker but I am hesitant to mix that in.

@jhorman
Copy link

jhorman commented Jul 11, 2019

This would be awesome. Sometimes you have tasks of variable lengths and so it is hard to decide on a visibility timeout. If tasks could dynamically extend would solve a lot of issues.

A simple approach might just be a method extend_visibility(timedelta(seconds=10)) that internally uses a thread local to get the current ReceiptHandle. Another option would be an optional keyword argument to functions of _reciept_handle or something, with the corresponding extend_visibility(receipt_handle, timedelta(seconds=10)).

I think for a v1 it would be ok to say pyqs doesn't do anything too fancy, just exposes a method.

jhorman added a commit to aiera-inc/PyQS that referenced this issue Jul 16, 2019
…handling.

When a task fails, immediately make it available again instead of waiting for visibility timeout.

Fixes spulec#47
@jhorman jhorman linked a pull request Jul 16, 2019 that will close this issue
@jhorman
Copy link

jhorman commented Jul 16, 2019

I opened a PR. The tests don't seem to run for me locally, and I didn't add more since I wanted to also make sure we agreed on this direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants