SQLAlchemy engine configuration is not passed to FAB based UI. Faced this issue when running Airflow with MySQL metadata store with wait_timeout = 120. Webserver is failing with Internal Server Error due to "[MySQL Server has gone away](https://docs.sqlalchemy.org/en/13/faq/connections.html#mysql-server-has-gone-away)" error. Settings like `sql_alchemy_pool_recycle` and  `sql_alchemy_pool_pre_ping` have no impact on FAB internal communication with MySQL.

**Apache Airflow version**: 1.10.12
airflow/www/app.py
db = SQLA()
    db.session = settings.Session
    db.init_app(flask_app)
    init_dagbag(flask_app)
    init_api_experimental_auth(flask_app)
    Cache(app=flask_app, config={'CACHE_TYPE': 'filesystem', 'CACHE_DIR': '/tmp'})
    init_flash_views(flask_app)
    configure_logging()
    configure_manifest_files(flask_app)
    with flask_app.app_context():
        init_appbuilder(flask_app)
        init_appbuilder_views(flask_app)
        init_appbuilder_links(flask_app)
        init_plugins(flask_app)
        init_error_handlers(flask_app)
        init_api_connexion(flask_app)
        init_api_experimental(flask_app)
        sync_appbuilder_roles(flask_app)
        init_jinja_globals(flask_app)
        init_logout_timeout(flask_app)
        init_xframe_protection(flask_app)
        init_permanent_session(flask_app)
    return flask_app
def cached_app(config=None, testing=False):
    """Return cached instance of Airflow WWW app"""
    global app  
    if not app:
        app = create_app(config=config, testing=testing)
    return app