[AIRFLOW-2204] Fix webserver debug mode #3118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA
Description
The command
airflow webserver -d
crashes because it tries to call the method run from thecached_app
(fromairflow.www.app
) returned value, i.e. aDispatcherMiddleware
instance. To run the flask app in debug mode (without gunicorn) it has to be created directly viacreate_app
(also fromairflow.www.app
), that returns the Flask instance.Tests
Very small changes, just a variable assign pushed a few lines down the usual flow and a line added for the debug flow.
(Some are to fix PEP8 compliance and pass
git diff upstream/master -u -- "*.py" | flake8 --diff
)Commits
My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
Passes
git diff upstream/master -u -- "*.py" | flake8 --diff