Skip to content

Vector not releasing file descriptors for rotated files #3440

@jszwedko

Description

@jszwedko

Copied from gitter https://gitter.im/timberio-vector/community?at=5f3172bcd28b99685e55795a

Hi, I am running into an issue with vector that it's not closing file descriptors on rotation of files via logrotate (file source). These are nginx logs. This is is happening for already rotated *.access.log.1 files which are rotated a second time, to *.access.log.2.gz. These deleted file descriptors accumulate over a period of time and we have to restart vector to fix disk alerts. Fingerprinting is currently configured with checksum strategy, with file source configured to check only for *.access.log file.

Vector config:

[sources.nginx_access_logs]
type                  = "file"
include               = ["/mnt/log/nginx/*.access.log"]
glob_minimum_cooldown = 10000
max_line_bytes        = 102400
file_key              = "file"
host_key              = "hostname"
max_read_bytes        = 20480
oldest_first          = true
[sources.nginx_access_logs.fingerprinting]
fingerprint_bytes    = 256
ignored_header_bytes = 0
strategy             = "checksum"

logrotate config:

/mnt/log/nginx/*.log {
        size 1G
        missingok
        rotate 3
        compress
        delaycompress
        notifempty
        create 644 www-data adm
        sharedscripts
        postrotate
                [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
        endscript
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: fileAnything `file` source relatedtype: bugA code related bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions