Bug 827036

Summary: Add support for terminating idle connections in sssd_nss
Product: Red Hat Enterprise Linux 6 Reporter: Dmitri Pal <dpal>
Component: sssdAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED ERRATA QA Contact: Kaushik Banerjee <kbanerje>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.4CC: grajaiya, jgalipea, prc
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.9.1-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: The SSSD client libraries did not close the file descriptors to pipes it uses to communicate with responder processes. Consequence: The number of file descriptors the responder processes keep open grew over time Fix: The SSSD proactively closes file descriptors that were not active for some time. Result: The file descriptor usage is steady now
Story Points: ---
Clone Of:
: 833169 (view as bug list) Environment:
Last Closed: 2013-02-21 09:24:01 UTC Type: ---
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: 833169    

Description Dmitri Pal 2012-05-31 13:38:02 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/1354

The attached patch adds support for a connection idle timer in sssd_nss which upon firing will check for and terminate idle connections.  The motivation for this is to prevent sssd_nss from running out of file descriptors when a large number of long lived processes keep open connections to sssd_nss.  The symptom can readily observed by running lsof on sssd_nss and counting the number instances of
/var/lib/sssd/pipes/nss.  Without the patch, we found sssd_nss becomes unresponsive on a number of our hosts with long lived connections such as imap servers.  We have encountered the problem in both RHEL 5 & 6 running sssd 1.5.1.

The patch adds an idle_timeout parameter to sssd.conf with a default value of zero that preserves the current behavior of not expiring any connections.  Expiry is only done when this parameter is set to a value greater than zero.

Comment 1 RHEL Program Management 2012-07-10 07:06:22 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Program Management 2012-07-11 02:05:56 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 4 Kaushik Banerjee 2012-11-19 09:02:26 UTC
Verified in version 1.9.2-13

Output of beaker automation run:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: bz827036 client_idle_timeout
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Stopping sssd: [  OK  ]
Starting sssd: [  OK  ]
[  OK  ]
spawn ssh -o StrictHostKeyChecking=no -l puser1 localhost
puser1@localhost's password: 
Last login: Sat Nov 17 04:27:21 2012 from localhost
[puser1@dell-pe1955-02 ~]$ id
uid=1001(puser1) gid=1001(Group1) groups=1001(Group1) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[puser1@dell-pe1955-02 ~]$ 
:: [   PASS   ] :: New nss file descriptors open. new_nss_fds:3 old_nss_fds:1
:: [   PASS   ] :: File '/var/log/sssd/sssd_nss.log' should contain 'Idle timer re-set for client'
:: [   PASS   ] :: File '/var/log/sssd/sssd_nss.log' should contain 'Client connected'
:: [   PASS   ] :: New pam file descriptors open. new_pam_fds:2 old_pam_fds:1
:: [   PASS   ] :: File '/var/log/sssd/sssd_pam.log' should contain 'Idle timer re-set for client'
:: [   PASS   ] :: File '/var/log/sssd/sssd_pam.log' should contain 'Client connected'
:: [   PASS   ] :: idle nss file descriptors were closed. num_nss_fds:1
:: [   PASS   ] :: File '/var/log/sssd/sssd_nss.log' should contain 'Terminating idle client'
:: [   PASS   ] :: File '/var/log/sssd/sssd_nss.log' should contain 'Terminated client'
:: [   PASS   ] :: idle pam file descriptors were closed. num_pam_fds:1
:: [   PASS   ] :: File '/var/log/sssd/sssd_pam.log' should contain 'Terminating idle client'
:: [   PASS   ] :: File '/var/log/sssd/sssd_pam.log' should contain 'Terminated client'
'4e00443f-4483-450f-884d-22d473eef7d7'
bz827036-client-idle-timeout result: PASS

Comment 5 errata-xmlrpc 2013-02-21 09:24:01 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2013-0508.html