15
15
# License for the specific language governing permissions and limitations
16
16
# under the License.
17
17
18
+ import logging
19
+
18
20
from oslo_log import log
19
21
from oslo_utils import importutils
20
22
30
32
CONF = nova .conf .CONF
31
33
32
34
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
+
33
49
def parse_args (argv , default_config_files = None , configure_db = True ,
34
50
init_rpc = True ):
35
51
log .register_options (CONF )
@@ -40,6 +56,12 @@ def parse_args(argv, default_config_files=None, configure_db=True,
40
56
else :
41
57
extra_default_log_levels = ['glanceclient=WARN' ]
42
58
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
+
43
65
# NOTE(danms): DEBUG logging in privsep will result in some large
44
66
# and potentially sensitive things being logged.
45
67
extra_default_log_levels .append ('oslo.privsep.daemon=INFO' )
0 commit comments