Skip to content

Commit

Permalink
Merge pull request apache#25 in TP/incubator-airflow from feature/DAT…
Browse files Browse the repository at this point in the history
…A-3676 to develop

* commit '07783b64cef17cb4309c26c4230ee32f12cb6b4b':
  DATA-3676: bump version to 1.8.2-up1.15.0
  [AIRFLOW-1559] Add sqlalchemy engine disposal
  • Loading branch information
Daniel Huang committed Nov 14, 2017
2 parents b0fab66 + 07783b6 commit 3d00d47
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions airflow/bin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ def webserver(args):
gunicorn_master_proc = None

def kill_proc(dummy_signum, dummy_frame):
settings.engine.dispose()
gunicorn_master_proc.terminate()
gunicorn_master_proc.wait()
sys.exit(0)
Expand Down
3 changes: 3 additions & 0 deletions airflow/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ def helper():
sys.stderr = f

try:
settings.engine.dispose()
# Re-configure logging to use the new output streams
log_format = settings.LOG_FORMAT_WITH_THREAD_NAME
settings.configure_logging(log_format=log_format)
Expand Down Expand Up @@ -404,6 +405,8 @@ def helper():
sys.stdout = original_stdout
sys.stderr = original_stderr
f.close()
# child is done with connection pool
settings.engine.dispose()

p = multiprocessing.Process(target=helper,
args=(),
Expand Down
2 changes: 1 addition & 1 deletion airflow/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
#

version = '1.8.2-up1.14.0'
version = '1.8.2-up1.15.0'
12 changes: 11 additions & 1 deletion airflow/www/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.
#
import logging
import socket
import signal
import six
import socket
import sys

from flask import Flask
from flask_admin import Admin, base
Expand All @@ -33,6 +35,9 @@


def create_app(config=None, testing=False):
# cleanup connections
signal.signal(signal.SIGTERM, sigterm_handler)

app = Flask(__name__)
app.secret_key = configuration.get('webserver', 'SECRET_KEY')
app.config['LOGIN_DISABLED'] = not configuration.getboolean('webserver', 'AUTHENTICATE')
Expand Down Expand Up @@ -152,6 +157,11 @@ def shutdown_session(exception=None):

return app


def sigterm_handler(signal, frame):
settings.engine.dispose()
sys.exit(0)

app = None


Expand Down
4 changes: 4 additions & 0 deletions upsight/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Next release (in development)

## 1.8.2-up1.15.0

* Pulled in [AIRFLOW-1559](https://issues.apache.org/jira/browse/AIRFLOW-1559) ([DATA-3676](https://kontagent.jira.com/browse/DATA-3676))

## 1.8.2-up1.14.0

* Display DAG run conf in the graph UI view ([DATA-3267](https://kontagent.jira.com/browse/DATA-3267))
Expand Down

0 comments on commit 3d00d47

Please sign in to comment.