Skip to content

Commit 0d67cc9

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Silence amqp heartbeat warning"
2 parents 4b62c90 + d6f6645 commit 0d67cc9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nova/config.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18+
import logging
19+
1820
from oslo_log import log
1921
from oslo_utils import importutils
2022

@@ -30,6 +32,20 @@
3032
CONF = nova.conf.CONF
3133

3234

35+
def rabbit_heartbeat_filter(log_record):
36+
37+
# Note the type in the log message was fixed in
38+
# change Id11db4113c9b1c3add602192c1e915218704ef27
39+
# but we handle both form to allow this to be backported
40+
# without consideration of the version of oslo.messaging used.
41+
# TODO(sean-k-mooney): remove support for typo in follow up
42+
# to allow this to be easily backported without modification.
43+
messages = [
44+
"Unexpected error during heartbeart thread processing",
45+
"Unexpected error during heartbeat thread processing"]
46+
return not any(msg in log_record.msg for msg in messages)
47+
48+
3349
def parse_args(argv, default_config_files=None, configure_db=True,
3450
init_rpc=True):
3551
log.register_options(CONF)
@@ -40,6 +56,12 @@ def parse_args(argv, default_config_files=None, configure_db=True,
4056
else:
4157
extra_default_log_levels = ['glanceclient=WARN']
4258

59+
# NOTE(sean-k-mooney): this filter addresses bug #1825584
60+
# https://bugs.launchpad.net/nova/+bug/1825584
61+
# eventlet monkey-patching breaks AMQP heartbeat on uWSGI
62+
rabbit_logger = logging.getLogger('oslo.messaging._drivers.impl_rabbit')
63+
rabbit_logger.addFilter(rabbit_heartbeat_filter)
64+
4365
# NOTE(danms): DEBUG logging in privsep will result in some large
4466
# and potentially sensitive things being logged.
4567
extra_default_log_levels.append('oslo.privsep.daemon=INFO')

0 commit comments

Comments
 (0)