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

Add timeout to resolving DOIs and URLs #99

Open
richard-jones opened this issue Aug 15, 2014 · 2 comments
Open

Add timeout to resolving DOIs and URLs #99

richard-jones opened this issue Aug 15, 2014 · 2 comments
Assignees
Milestone

Comments

@richard-jones
Copy link
Member

In order to make the API more responsive, we should kill threads which take too long to process.

@richard-jones richard-jones added this to the Jisc Monitor milestone Aug 15, 2014
@richard-jones richard-jones self-assigned this Aug 15, 2014
@richard-jones richard-jones removed their assignment Sep 10, 2014
@emanuil-tolev emanuil-tolev self-assigned this Sep 12, 2014
@emanuil-tolev
Copy link
Contributor

I have done a bit of investigation here with @nimphal - this is a bit of a tangle, as can be expected.

So we have:
a/ celery timeouts
b/ requests timeouts

Counter-intuitively, b/ is NOT set by default. But there's no point in just adding a timeout argument to the requests.get call and putting our feet up - we need to understand what is causing the timeouts (and also why is our celery 5 min timeout not working). Thus I think we should build a very very small 7-line flask app which just hangs (busy-wait) and try to download a DOI from it. Then we can add the requests timeout, and see if that fixes the problem - as well as proceed to see why exactly does celery allow tasks to run forever.

Also to note, @nimphal may have found out that the way we specify celery timeout is just wrong, as in that cmdline arg will be ignored because it doesn't exist. I haven't had time to follow up on that, but it could be done after we reproduce the hanging on a developer's machine (e.g. by using a flask app).

Wrt the busy-wait mini-app: I think I know how to do some pretty nasty stuff - infinite sleep is one thing, but if needed, I can write a small script (not with Flask) which opens a socket to respond to the OAG request coming in, and never closes it, but also never sends any data back. This should screw nicely with the I/O layer in Python(OAG).

@emanuil-tolev
Copy link
Contributor

celery/celery#1129 memory leaks in celery when timeout params are used, problem was in 3.0 branch which we use and has been backported but I'm pretty sure our celery isn't new enough to have the patch.

Consider upgrading celery if it continues to eat memory, since we do need those timeouts too.

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

No branches or pull requests

2 participants