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 Flask.before_request instead of Flask.before_first_request to work around the re-entry deadlock introduced in Flask 0.11 #184

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

joeyespo
Copy link
Owner

@joeyespo joeyespo commented Jul 1, 2016

Fixes #182.

Flask changed its behavior in 0.11 by making before_first_request deadlock if the handler causes another request before finishing. The _before_request hook is still re-entrant, so this can be fixed without changing much code.

Note that Flask's change in behavior addresses some real problems. So a larger, more proper fix later on could be to change Grip._retrieve_styles (or more specifically, Grip._get_styles) to access the cached files directly instead of using a request to do so.

…karound the re-entry deadlock introduced in Flask 0.11.
@joeyespo joeyespo added the bug label Jul 1, 2016
@joeyespo
Copy link
Owner Author

joeyespo commented Jul 1, 2016

Note: The test failure is coming from pypy3 (which currently implements the now-outdated Python 3.2 version). Ignoring this since later versions of Python 3 are more stable, and the next version of Flask works around this issue. See this Flask issue for details.

@joeyespo joeyespo merged commit 8959b6e into master Jul 1, 2016
@joeyespo joeyespo deleted the fix-182 branch July 1, 2016 04:58
@joeyespo joeyespo mentioned this pull request Jul 1, 2016
@JasonYao JasonYao mentioned this pull request Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken --export command
1 participant