You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/07 17:11:18 UTC

[GitHub] [airflow] uranusjr commented on issue #8687: Airflow webserver should handle signals immediately when starting

uranusjr commented on issue #8687:
URL: https://github.com/apache/airflow/issues/8687#issuecomment-815080410


   I can’t seem to replicate this, The Gunicorn subprocess can’t be kiled immediately (this seems like a Gunicorn issue and not Airflow), but after the Gunicorn subprocess emits the *Can't connect to* log, Ctrl-C correctly makes it exit (and thus ending the parent Airflow process.
   
   ```
   $ airflow webserver
   ...
   =================================================================
   [2021-04-07 17:03:48 +0000] [2031] [INFO] Starting gunicorn 19.9.0
   [2021-04-07 17:03:48 +0000] [2031] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:03:48 +0000] [2031] [ERROR] Retrying in 1 second.
   [2021-04-07 17:03:49 +0000] [2031] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:03:49 +0000] [2031] [ERROR] Retrying in 1 second.
   [2021-04-07 17:03:50 +0000] [2031] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:03:50 +0000] [2031] [ERROR] Retrying in 1 second.
   [2021-04-07 17:03:51 +0000] [2031] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:03:51 +0000] [2031] [ERROR] Retrying in 1 second.
   [2021-04-07 17:03:52 +0000] [2031] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:03:52 +0000] [2031] [ERROR] Retrying in 1 second.
   [2021-04-07 17:03:53 +0000] [2031] [ERROR] Can't connect to ('0.0.0.0', 8080)
   ^C[2021-04-07 17:03:57,021] {webserver_command.py:431} INFO - Received signal: 2. Closing gunicorn.
   $ echo $?
   0
   ```
   
   Pressing Ctrl-C while Gunicorn is still connecting also correctly sends a SIGINT (2) to Gunicorn, and makes it exit after the connection failures:
   
   ```
   $ airflow webserver
   ...
   =================================================================
   [2021-04-07 17:01:53 +0000] [1923] [INFO] Starting gunicorn 19.9.0
   [2021-04-07 17:01:53 +0000] [1923] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:01:53 +0000] [1923] [ERROR] Retrying in 1 second.
   [2021-04-07 17:01:54 +0000] [1923] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:01:54 +0000] [1923] [ERROR] Retrying in 1 second.
   ^C[2021-04-07 17:01:55,025] {webserver_command.py:431} INFO - Received signal: 2. Closing gunicorn.
   [2021-04-07 17:01:55 +0000] [1923] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:01:55 +0000] [1923] [ERROR] Retrying in 1 second.
   [2021-04-07 17:01:56 +0000] [1923] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:01:56 +0000] [1923] [ERROR] Retrying in 1 second.
   [2021-04-07 17:01:57 +0000] [1923] [ERROR] Connection in use: ('0.0.0.0', 8080)
   [2021-04-07 17:01:57 +0000] [1923] [ERROR] Retrying in 1 second.
   [2021-04-07 17:01:58 +0000] [1923] [ERROR] Can't connect to ('0.0.0.0', 8080)
   $ echo $?
   0
   ```
   
   The same behaviour is observed between Gunicorn 19.9.0 (which the OP uses) and 19.10.0 (the version suggested by the official constraints file), against Airflow master (but I could not find any relevant differences in 1.10.10).
   
   I wonder if the Python version is relevant here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org