Bug 1758073

Summary: teamd LACP runner sends debug messages even though log level is set to INFO
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: libteamAssignee: Xin Long <lxin>
Status: CLOSED ERRATA QA Contact: LiLiang <liali>
Severity: high Docs Contact:
Priority: high    
Version: 8.0CC: jmaxwell, network-qe, sukulkar
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libteam-1.29-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:53:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1807630    

Description Renaud Métrich 2019-10-03 08:10:07 UTC
This bug was initially created as a copy of Bug #1758072

I am copying this bug because: it also applies to RHEL8



Description of problem:

teamd uses the libdaemon facility to send logs. When configuring a Team with LACP, customers can see 1 message from Debug level being printed every second, even though NetworkManager's log level (and teamd) is set to Info:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
eth1: lacp info state: XXX
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This is very annoying and pollutes the journal.

It appears that when using libdaemon and syslog facility, *no* filtering is performed by the libdaemon library:

dlog.c:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
 35 static int daemon_verbosity_level = LOG_INFO;

 46 void daemon_logv(int prio, const char* template, va_list arglist) {
 47     int saved_errno;
 48 
 49     saved_errno = errno;
 50 
 51     if (daemon_log_use & DAEMON_LOG_SYSLOG) {
 52         openlog(daemon_log_ident ? daemon_log_ident : "UNKNOWN", LOG_PID, LOG_DAEMON);
 53         vsyslog(prio | LOG_DAEMON, template, arglist);
 54     }
 55 
 56     if (prio > daemon_verbosity_level)
 57         goto end_daemon_logv;
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This is intended behaviour and the root cause of the issue:

dlog.h:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
 94 /** Setter for the verbosity level of standard output.
 95  *
 96  * @param verbosity_prio Minimum priority level for messages to output
 97  * on standard output/error
 98  *
 99  * Allows to decide which messages to output on standard output/error
100  * streams. All messages are logged to syslog and this setting does
101  * not influence that.
102  *
103  * The default value is LOG_WARNING.
104  *
105  * @since 0.14
106  * @see DAEMON_SET_VERBOSITY_AVAILABLE
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

See also BZ #1758066 related to libdaemon to clarify if this is really intented behaviour.
If so, then libteam needs to filter out unwanted levels.


Version-Release number of selected component (if applicable):

libteam


How reproducible:

Always


Steps to Reproduce:
1. Set up a team with LACP

  TEAM_CONFIG="{ \"device\": \"team0\", \"runner\": { \"name\": \"lacp\", \"active\": true, \"fast_rate\": true, \"tx_hash\": [\"eth\", \"ipv4\", \"ipv6\"] }, \"link_watch\": {\"name\": \"ethtool\"}, \"ports\": {\"eth1\": {}, \"eth2\": {}} }"

Actual results:

Message printed every second

Expected results:

No message

Comment 1 Hangbin Liu 2020-01-13 02:57:01 UTC
Hi Xin Long,

We need these patches for this bug.

f32310b libteam: wapper teamd_log_dbg with teamd_log_dbgx
575edc0 teamd: fix build error in expansion of macro teamd_log_dbgx
4990a8c teamd/lacp: fix segfault due to NULL pointer dereference

Thanks
Hangbin

Comment 5 LiLiang 2020-07-02 01:00:33 UTC
verified on libteam-1.29-5.el8.x86_64

Comment 8 errata-xmlrpc 2020-11-04 01:53:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libteam bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4512