log_files_count and log_file_size in contrail-vrouter-agent.conf are not parsed correctly

Bug #1692039 reported by Valentine Sinitsyn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenContrail
New
Undecided
Unassigned

Bug Description

Steps to reproduce:
1. Add log_files_count = N to /etc/contrail/contrail-vrouter-agent.conf or whatever config file your Contrail vRouter Agent uses
2. Start the agent

Expected results:
1. The maximum number of agent log files to keep is set to N

Actual results:
1. The maximum number of agent log files to keep is undetermined. To testify this, one can start /usr/bin/contrail-vrouter-agent under debugger and set breakpoint at LoggingInit() function to verify maxBackupIndex argument, or check AgentParam object directly.

Possible cause:
AgentParam::ParseDefaultSectionArguments() tries to get DEFAULT.log_files_count and DEFAULT.log_file_size from the object's properties tree. However, AgentParam::InitFromConfig() only puts unregistered options in the tree, which is not the case for log_files_count and log_file_size. GetValueFromTree<int,long>() should really be GetOptValue<int,long>() for these options.

Revision history for this message
Valentine Sinitsyn (valentine-sinitsyn) wrote :

There is a not-so-evident consequence of this bug.

As log_files_count is undetermined, it can be pretty big, which makes log4cplus to rename many non-existent log files.

At least on some kernels we checked, continuously renaming a non-existing file (say, "while true; do mv a$i b$((++i)); done") wastes slab-allocated kernel memory for dentry cache. Under unfavourable conditions, this can lead to RAM starvation on the hypervisor and ultimately loss of the node.

Revision history for this message
Valentine Sinitsyn (valentine-sinitsyn) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.