From cc73bb21fda22fa22be86d4f096574d955ce0cc1 Mon Sep 17 00:00:00 2001 From: Kaifeng Wang Date: Tue, 22 Jan 2019 13:48:13 +0800 Subject: [PATCH] Limit the timeout value of heartbeat_timeout Set the heartbeat_timeout value too high will cause OverflowError, which affects places where the delta value is used to check the online status of a conductor. This involves get_offline_conductors, _filter_active_conductors, and descending caller like the _check_orphan_nodes periodic task, /v1/drivers endpoint, etc. Limit the max value to 10 years as [1] does. [1] https://review.openstack.org/#/c/631538 Story: 2004807 Task: 29021 Change-Id: I2b47fa6747e2f97c6910be708c328bed9daba455 --- ironic/conf/conductor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ironic/conf/conductor.py b/ironic/conf/conductor.py index 0bf16fd7f4..6495e805da 100644 --- a/ironic/conf/conductor.py +++ b/ironic/conf/conductor.py @@ -41,6 +41,9 @@ opts = [ 'http:// or https://.')), cfg.IntOpt('heartbeat_timeout', default=60, + # We're using timedelta which can overflow if somebody sets this + # too high, so limit to a sane value of 10 years. + max=315576000, help=_('Maximum time (in seconds) since the last check-in ' 'of a conductor. A conductor is considered inactive ' 'when this time has been exceeded.')),