Skip to content

Commit 94cf7a4

Browse files
lewisdennyIhar Hrachyshka
authored andcommitted
Add max limit to agent_down_time
The agent_down_time ends up being passed to an eventlet green-thread; under the hood, this uses a CPython C-types interface with a limitation of (2^32 / 2 - 1) INT_MAX (as defined in C) where int is usually 32 bits I have set the max value to (2^32 / 2 - 1)/1000 as agent_down_time configured in seconds, this ends up being 2147483. This patch is required as passing a larger number causes this error: OverflowError: timeout is too large If a user currently has a value larger than (2^32 / 2 - 1)/1000 set, Neutron Server will fail to start and will print out a very helpful error message. Conflicts: neutron/conf/agent/database/agents_db.py Closes-Bug: #2028724 Change-Id: Ib5b943344cddbd468c00768461ba1ee00a2b4c58 (cherry picked from commit 6fef1e6)
1 parent 5ff3821 commit 94cf7a4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

neutron/conf/agent/database/agents_db.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
from neutron.common import _constants
1717

1818
AGENT_OPTS = [
19+
# The agent_down_time value can only be a max of INT_MAX (as defined in C),
20+
# where int is usually 32 bits. The agent_down_time will be passed to
21+
# eventlet in milliseconds and any number higher will produce an OverFlow
22+
# error. More details here: https://bugs.launchpad.net/neutron/+bug/2028724
1923
cfg.IntOpt('agent_down_time', default=75,
24+
max=((2**32 / 2 - 1) // 1000),
2025
help=_("Seconds to regard the agent is down; should be at "
2126
"least twice report_interval, to be sure the "
2227
"agent is down for good.")),
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
The config option ``agent_down_time`` is now limited to a maximum value of
5+
`2147483`, as neutron-server will fail to start if it is configured higher.
6+
See bug `2028724 <https://bugs.launchpad.net/neutron/+bug/2028724>`_ for more information.

0 commit comments

Comments
 (0)