From 503a78b47c49e9361d606a967605796baaa1b87c Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Mon, 25 Sep 2017 15:28:34 +0900 Subject: [PATCH] Deprecate idle_timeout in api_database In oslo.db, the 'idle_timeout' has been renamed to 'connection_recycle_time' in I5e39d5ac81eaa8d85b1dfb18862fe27695ab8b96. So the 'idle_timeout' in 'api_database' group is renamed to 'connection_recycle_time' as well. Change-Id: Ie6e003be241d071904a99fdf6d83bc1186602f99 Closes-Bug: #1716786 --- nova/conf/database.py | 3 ++- nova/db/sqlalchemy/api.py | 2 +- releasenotes/notes/bug-1716786-7c3fc081f29f4dac.yaml | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1716786-7c3fc081f29f4dac.yaml diff --git a/nova/conf/database.py b/nova/conf/database.py index b0d64db356b8..1096c12a2b6a 100644 --- a/nova/conf/database.py +++ b/nova/conf/database.py @@ -63,8 +63,9 @@ api_db_opts = [ cfg.StrOpt('mysql_sql_mode', default='TRADITIONAL', help=''), - cfg.IntOpt('idle_timeout', + cfg.IntOpt('connection_recycle_time', default=3600, + deprecated_name='idle_timeout', help=''), # TODO(markus_z): We should probably default this to 5 to not rely on the # SQLAlchemy default. Otherwise we wouldn't provide a stable default. diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 5ed2b985419f..deef78a3d1fd 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -87,7 +87,7 @@ def _get_db_conf(conf_group, connection=None): __autocommit=True, expire_on_commit=False, mysql_sql_mode=conf_group.mysql_sql_mode, - idle_timeout=conf_group.idle_timeout, + connection_recycle_time=conf_group.connection_recycle_time, connection_debug=conf_group.connection_debug, max_pool_size=conf_group.max_pool_size, max_overflow=conf_group.max_overflow, diff --git a/releasenotes/notes/bug-1716786-7c3fc081f29f4dac.yaml b/releasenotes/notes/bug-1716786-7c3fc081f29f4dac.yaml new file mode 100644 index 000000000000..950a55e4f27f --- /dev/null +++ b/releasenotes/notes/bug-1716786-7c3fc081f29f4dac.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``idle_timeout`` option in the ``api_database`` group + has been renamed to ``connection_recycle_time``. \ No newline at end of file