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
[AIRFLOW-1235] Fix webserver's odd behaviour #2330
Conversation
@sekikn, thanks for your PR! By analyzing the history of the files in this pull request, we identified @plypaul, @mistercrunch and @saguziel to be potential reviewers. |
CI failed on test_trigger_dag_for_date, which is reported as AIRFLOW-1245. It's irrelevant to this fix since CI failed only on Python 2.7 x PostgreSQL backend. |
AIRFLOW-1245 has been merged: #2325 |
Thanks for the information @icorbett. I've just rebased the PR. |
Codecov Report
@@ Coverage Diff @@
## master #2330 +/- ##
==========================================
+ Coverage 72.98% 73.47% +0.49%
==========================================
Files 180 180
Lines 12654 12668 +14
==========================================
+ Hits 9235 9308 +73
+ Misses 3419 3360 -59
Continue to review full report at Codecov.
|
f10acf9
to
ba1c283
Compare
Rebased on master. |
Why isn't this test executed on Travis? |
Thanks for the review @Fokko, I have some reasons to disable it on Travis:
Instead of enabling this on Travis, I ran it locally and confirmed that it succeeded. |
@sekikn Thanks for elaboration on the problem. I think we should find a way of isolating these tests. For me, a test that isn't automated, is as valuable as no test. I hope you understand, and this is something at the core of Airflow, so we have to make sure that it is tested well. |
I understand your concern. I'll update the PR if I come up with some good solution. Thanks :) |
@sekikn Thanks! |
Updated PR. Instead of killing gunicorn actually using pidfile, it uses mock.patch to emulate the situation that gunicorn doesn't respond. @Fokko would you take a look? |
14065d2
to
52c944d
Compare
Updated PR. Removed unnecessary code in newly added test as #3123 was merged. |
@sekikn Could you rebase on master? |
Rebased on master. CI failure occurred on test_authorized and it's irrelevant to this PR. It's continued for at least 3 days (e.g. https://travis-ci.org/apache/incubator-airflow/builds/351858876). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from one variable which seems to need renaming, this looks good. Let's fix this and merge. @sekikn
airflow/bin/cli.py
Outdated
if 0 < timeout and timeout <= time.time() - t: | ||
raise AirflowWebServerTimeout( | ||
"No response from gunicorn master within {0} seconds" | ||
.format(master_timeout)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be called just timeout
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. I'll update the PR. Thanks!
In some cases, the gunicorn master shuts down but the webserver monitor process doesn't. This PR add timeout functionality to shutdown all related processes in such cases.
+1 I like it. |
@artwr merge? |
Done |
@artwr @johnarnold Thanks a lot! |
In some cases, the gunicorn master shuts down but the webserver monitor process doesn't. This PR add timeout functionality to shutdown all related processes in such cases. Dear Airflow maintainers, Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below! ### JIRA - [x] My PR addresses the following [Airflow JIRA] (https://issues.apache.org/jira/browse/AIRFLOW/) issues and references them in the PR title. For example, "[AIRFLOW-XXX] My Airflow PR" - https://issues.apache.org/jira/browse/AIRFLOW-1235 ### Description - [x] Here are some details about my PR, including screenshots of any UI changes: In some cases, the gunicorn master shuts down but the webserver monitor process doesn't. This PR add timeout functionality to shutdown all related processes in such cases. ### Tests - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: tests.core:CliTests.test_cli_webserver_shutdown_wh en_gunicorn_master_is_killed ### Commits - [x] 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](http://chris.beams.io/posts/git- commit/)": 1. Subject is separated from body by a blank line 2. Subject is limited to 50 characters 3. Subject does not end with a period 4. Subject uses the imperative mood ("add", not "adding") 5. Body wraps at 72 characters 6. Body explains "what" and "why", not "how" Closes apache#2330 from sekikn/AIRFLOW-1235
Dear Airflow maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
In some cases, the gunicorn master shuts down
but the webserver monitor process doesn't.
This PR add timeout functionality to shutdown
all related processes in such cases.
Tests
tests.core:CliTests.test_cli_webserver_shutdown_when_gunicorn_master_is_killed
Commits