Bug 1176242 - glfs_h_creat() leaks file descriptors
Summary: glfs_h_creat() leaks file descriptors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: libgfapi
Version: mainline
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
Assignee: Niels de Vos
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On:
Blocks: 1176309 1176310 1176311
TreeView+ depends on / blocked
 
Reported: 2014-12-19 20:07 UTC by Niels de Vos
Modified: 2015-05-14 17:45 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1176309 1176310 1176311 (view as bug list)
Environment:
Last Closed: 2015-05-14 17:28:46 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Niels de Vos 2014-12-19 20:07:18 UTC
Description of problem:
When running stress and performance tests against nfs-ganesha, the 
number of open file descriptors increases continously. If the tests run 
long enough, the brick processes will eventually run out of file
descriptors.


Version-Release number of selected component (if applicable):
current master and older versions that have glfs_h_creat()

How reproducible:
100%

Steps to Reproduce:
1. setup nfs-ganesha to export a (single brick) volume
2. create files on an nfs mountpoint
3. check the open file descriptors of the brick process

Actual results:
See the file descriptors of the brick process increase...

Expected results:
Increasing number of descriptors, but see it reduce again too.

Additional info:
This seems to be caused by glfs_h_creat() which allocates a 'struct
glfs_fd', but does not release it. A normal glfs_creat() returns the
file descriptor to the application, whereas glfs_h_creat() returns a
handle (struct glfs_object). The file descriptor associated with the
handle can not be release by glfapi-applications.

Comment 1 Anand Avati 2014-12-19 20:08:06 UTC
REVIEW: http://review.gluster.org/9318 (gfapi: always close the fd in glfs_h_creat()) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 2 Anand Avati 2014-12-20 10:21:01 UTC
COMMIT: http://review.gluster.org/9318 committed in master by Niels de Vos (ndevos) 
------
commit 0e78a12381e988a06e1d5a2dd592d132e24a4e10
Author: Niels de Vos <ndevos>
Date:   Fri Dec 19 18:27:14 2014 +0100

    gfapi: always close the fd in glfs_h_creat()
    
    When running stress and performance tests against nfs-ganesha, the
    number of open file descriptors increases continously. If the tests run
    long enough, the brick processes will eventually run out of file
    descriptors.
    
    This seems to be caused by glfs_h_creat() which allocates a 'struct
    glfs_fd', but does not release it. A normal glfs_creat() returns the
    file descriptor to the application, whereas glfs_h_creat() returns a
    handle (struct glfs_object). The file descriptor associated with the
    handle can not be release by glfapi-applications.
    
    This fd-leak can be prevented by destroying the 'struct glfs_fd' before
    returning the 'struct gfls_object' to the gfapi-application.
    
    Change-Id: I32465077a35cd0449a8e584c53899b32f022e5af
    BUG: 1176242
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/9318
    Reviewed-by: Kaleb KEITHLEY <kkeithle>
    Reviewed-by: Shyamsundar Ranganathan <srangana>
    Tested-by: Gluster Build System <jenkins.com>

Comment 3 Niels de Vos 2015-05-14 17:28:46 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 4 Niels de Vos 2015-05-14 17:35:46 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 5 Niels de Vos 2015-05-14 17:38:08 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 6 Niels de Vos 2015-05-14 17:45:24 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.