-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OVS leak log file when rotating logs #2003
Comments
So, this should be a fix in OVS monitoring script? |
@jianjuns yes, this needs to be fixed in OVS. I cannot think of any workaround we can do in Antrea: the monitor processes need to re-open their log files (like the main OVS daemons), otherwise the file can never be deleted by the OS. Fortunately that's only a 100MB "leak" with the default log rotation settings. It also means that the logging for the monitor processes is broken (they don't log to the right file after the first rotation), but that part doesn't really matter. I believe the OVS folks are looking into this already. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment, or this will be closed in 180 days |
/remove-lifecycle stale |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
This has been addressed on the master branch of OVS: openvswitch/ovs@78ff396. We will include the patch in the OVS version that we ship with Antrea v1.7.0. |
There is no update that significantly impacts Antrea, now that we no longer rely on the userspace datapath. We also apply a patch that is available in the 'master' branch, but hasn't been released yet. The patch fixes antrea-io#2003. Signed-off-by: Antonin Bas <[email protected]>
There is no update that significantly impacts Antrea, now that we no longer rely on the userspace datapath. We also apply a patch that is available in the 'master' branch, but hasn't been released yet. The patch fixes #2003. Signed-off-by: Antonin Bas <[email protected]>
Describe the bug
One of our users reported an issue with log rotation in Antrea. I tracked it down to an issue in Open vSwitch. When using log rotation with OVS (OVS ships with configuration files for logrotate for multiple distributions), if monitoring is used for the ovs-vswitchd and ovsdb-server daemons, the first log file is "leaked". Antrea relies on logrotate to rotate the OVS log files and is affected by this issue (#1329).
To Reproduce
Steps to reproduce the behavior. The steps below were executed by exec'ing into an Antrea Agent Pod (antrea-ovs container). We force a log rotation by increasing the log file size artificially and running logrotate manually, but the same situation will arise after a while in Antrea (OVS generates logs when a Pod is created / deleted, and Antrea runs logrotate itself every hour).
/var/log/openvswitch/ovs-vswitchd.log
log file artificiallyYou can see that the 1GB file is still present on disk, because the monitor process for ovs-vswitchd still has a reference to the file.
Actual behavior
logrotate moves the log file from ovs-vswitchd.log to ovs-vswitchd.log.1, then compresses ovs-vswitchd.log.1 and tells ovs-vswitch to re-open its log file (using ovs-appctl vlog/reopen). However, only the ovs-vswitchd process is notified over the control socket, the monitoring process is NOT notified. Therefore the monitoring process keeps referring to the old file (the file was moved but the inode is the same), which can never be deleted.
Expected
The monitoring daemon should be notified by ovs-appctl and should re-open its log file.
Versions:
Antrea: v0.13.1, v0.14.0-dev
The text was updated successfully, but these errors were encountered: