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

use EventletTimeoutMiddleware if using eventlet #4209

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

risicle
Copy link
Member

@risicle risicle commented Oct 3, 2024

See alphagov/notifications-utils#1157

This successfully raises an exception after 30s, which is what we previously expected our gunicorn timeouts to be set to everywhere (and is what they're set to on our non-eventlet gunicorn apps - template-preview-web & antivirus-web). Perhaps we should be setting it to 60s though - what our cloudfront and ALBs supposedly use - because this will cause the same visible behaviour as we currently get.

☝️ Changed my mind - switched this to 60s for the reasons suggested above.

I can demonstrate this working on dev-a to anyone interested.

Note that even though it will stop this app processing a request after N seconds, that doesn't mean this cancellation will necessarily be propagated to whatever this app is waiting on (database, another http api..). That sort of thing would require more plumbing.

It would be useful if a developer would check this doesn't break their local development workflow before I merge this. It should have no effect for them because most development modes don't use eventlet by default.

@risicle risicle force-pushed the ris-eventlet-timeout-utils branch 2 times, most recently from d94fef5 to f28883a Compare October 3, 2024 12:51
@risicle risicle marked this pull request as ready for review October 3, 2024 12:52
also catch EventletTimeout exceptions, turning these into 504s,
which are the closest thing to an application timeout standard
codes seem to cover

60s timeout to start with as this matches our cloudfront/ALB
timeouts and so should present the same behaviour to external
users
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 this pull request may close these issues.

1 participant