Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1960536

Summary: rsyslog fd leak when Fsync="on" is set
Product: Red Hat Enterprise Linux 8 Reporter: masanari iida <masanari.iida>
Component: rsyslogAssignee: Attila Lakatos <alakatos>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: chorn, dapospis, rsroka
Target Milestone: betaKeywords: AutoVerified, Patch, Security, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rsyslog-8.2102.0-3.el8 Doc Type: Bug Fix
Doc Text:
Cause: a bug in the imjournal module together with its option Fsync is set to "on" Consequence: rsyslog was opening new 3 FDs for approximately each 10 log messages Fix: Result: rsyslog does not eat up more FDs on increasing number of messages
Story Points: ---
Clone Of:
: 1972069 (view as bug list) Environment:
Last Closed: 2021-11-09 18:05:17 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: 1972069    

Description masanari iida 2021-05-14 06:57:34 UTC
Description of problem:
If I set FSync=on in imjournal module, the rsyslogd opens 3 additional
/var/lib/rsyslog everytime 10 lines of messages are written to log.
This symptom will consume all file descriptors in the end.

Version-Release number of selected component (if applicable):
rsyslog-8.1911.0-6.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install latest rsyslog.

2.Edit rsyslog.conf

2.1 disable following line. 
#$ModLoad imjournal # provides access to the systemd journal

2.2 add following lines.
module(load="imjournal"
StateFile="imjournal.state"
IgnoreNonValidStatefile="on"
IgnorePreviousMessages="on"
FSync="on"                    <==
Ratelimit.Interval="0"
)

3. Restart rsyslogd

4. Keep watching number of open files.
while true
do  
  lsof |grep /var/lib/rsyslog |wc -l
  sleep 15
done

If the number of open files change slower,
then use logger(1) to send messages to /var/log/messages.
If you send 10 messages,  rsyslogd will add 3 additional
/var/lib/rsyslog open directories.

Actual results:
The number of open directory (/var/lib/rsyslog) keep growing.

96
96
99      <- add 3
99
99
99
99
99
99
102    <- add 3

Expected results:
Number of open files by rsyslogd should be always low number.

Additional info:

This symptom can be reproduced on rsyslog on RHEL7,
and also rsyslog-8.2010.0-1.fc33.x86_64.

Comment 1 masanari iida 2021-05-19 06:01:50 UTC
Test with rsyslog from RHEL8.4,  the symptom still exist.

rsyslog-8.1911.0-7.el8.x86_64
rsyslog-relp-8.1911.0-7.el8.x86_64
rsyslog-gssapi-8.1911.0-7.el8.x86_64
rsyslog-gnutls-8.1911.0-7.el8.x86_64

Comment 2 Attila Lakatos 2021-05-31 07:30:16 UTC
Hello,

Thank you for the report. I can confirm that the bug is still present in the latest rsyslog release.
I've attached a GitHub link to upstream solution.

Comment 12 errata-xmlrpc 2021-11-09 18:05:17 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 (rsyslog and its related dependencies 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-2021:4193