Bug 1443145 - Free runtime allocated resources upon graph switch or glfs_fini()
Summary: Free runtime allocated resources upon graph switch or glfs_fini()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1425623
TreeView+ depends on / blocked
 
Reported: 2017-04-18 15:08 UTC by Niels de Vos
Modified: 2018-03-15 11:17 UTC (History)
2 users (show)

Fixed In Version: glusterfs-4.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-15 11:17:12 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Niels de Vos 2017-04-18 15:08:16 UTC
Description of problem:
There are several resource leaks in libglusterfs. When glfs_fini() is called, all resources allocated by libglusterfs should be free'd. This is important for long running processes like NFS-Ganesha, QEMU and others.

Comment 1 Worker Ant 2017-04-18 15:21:27 UTC
REVIEW: https://review.gluster.org/17076 (core: move glusterfs_ctx_defaults_init() to libglusterfs) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 2 Worker Ant 2017-04-18 17:20:54 UTC
REVIEW: https://review.gluster.org/17078 (logging: free the strdup'd filename on gf_log_fini()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 3 Worker Ant 2017-04-21 12:16:30 UTC
REVIEW: https://review.gluster.org/17099 (core: free 'global' TLS allocations when the last ctx is destroyed) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 4 Worker Ant 2017-04-24 09:31:32 UTC
REVIEW: https://review.gluster.org/17076 (core: move glusterfs_ctx_defaults_init() to libglusterfs) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 5 Worker Ant 2017-09-01 10:56:03 UTC
REVIEW: https://review.gluster.org/17078 (logging: free the strdup'd filename and ident on gf_log_fini()) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 6 Worker Ant 2017-09-01 11:17:21 UTC
REVIEW: https://review.gluster.org/17078 (logging: free the strdup'd filename and ident on gf_log_fini()) posted (#3) for review on master by Niels de Vos (ndevos)

Comment 7 Worker Ant 2017-09-04 08:50:13 UTC
REVIEW: https://review.gluster.org/17099 (core: free 'global' TLS allocations when the last ctx is destroyed) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 8 Worker Ant 2017-09-04 08:50:18 UTC
REVIEW: https://review.gluster.org/18200 (snapview-server: use glfs_new_from_ctx() to prevent creating a new ctx) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 9 Worker Ant 2017-10-10 14:05:17 UTC
REVIEW: https://review.gluster.org/18474 (md-cache: free "struct mdc_conf" in fini()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 10 Worker Ant 2017-10-10 14:06:49 UTC
REVIEW: https://review.gluster.org/18475 (rpc: free conn->name in rpc_clnt_destroy()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 11 Worker Ant 2017-10-10 14:08:45 UTC
REVIEW: https://review.gluster.org/18476 (gfapi: free xlator_cmdline_option_t when set through glfs_set_xlator_option()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 12 Worker Ant 2017-10-10 14:10:22 UTC
REVIEW: https://review.gluster.org/18477 (dht: free memory allocated in dht_init() and dht_init_subvolumes()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 13 Worker Ant 2017-10-10 14:13:08 UTC
REVIEW: https://review.gluster.org/18478 (rpc: free registered callback programs) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 14 Worker Ant 2017-10-10 14:25:10 UTC
REVIEW: https://review.gluster.org/17078 (logging: free the strdup'd filename and ident on gf_log_fini()) posted (#4) for review on master by Niels de Vos (ndevos)

Comment 15 Worker Ant 2017-10-11 03:59:27 UTC
COMMIT: https://review.gluster.org/18477 committed in master by N Balachandran (nbalacha) 
------
commit 6628b9426918010d203a7de19e3e187eeb077b0d
Author: Niels de Vos <ndevos>
Date:   Mon Oct 9 17:56:56 2017 +0200

    dht: free memory allocated in dht_init() and dht_init_subvolumes()
    
    When glfs_fini() is called, DHT fails to free all memory allocations
    which result in a considerable leak.
    
    Change-Id: I37c6de5c93ca4516266dbe8288b4a416f5589901
    BUG: 1443145
    Signed-off-by: Niels de Vos <ndevos>

Comment 16 Worker Ant 2017-10-11 04:55:35 UTC
COMMIT: https://review.gluster.org/18478 committed in master by Raghavendra G (rgowdapp) 
------
commit ec39ca32d942d49fd701156174abbba0b73bce2f
Author: Niels de Vos <ndevos>
Date:   Mon Oct 9 18:58:09 2017 +0200

    rpc: free registered callback programs
    
    Change-Id: I8c6f6b642f025d1faf74015b8f7aaecd7ebfd4d5
    BUG: 1443145
    Signed-off-by: Niels de Vos <ndevos>

Comment 17 Worker Ant 2017-10-11 04:57:42 UTC
COMMIT: https://review.gluster.org/18475 committed in master by Raghavendra G (rgowdapp) 
------
commit 6060b113f0f49fe9654fe03fc79576e591ed8a43
Author: Niels de Vos <ndevos>
Date:   Tue Oct 10 15:39:30 2017 +0200

    rpc: free conn->name in rpc_clnt_destroy()
    
    Change-Id: Idf99908aa48718a7faf7f0bbc647a679ec548282
    BUG: 1443145
    Signed-off-by: Niels de Vos <ndevos>

Comment 18 Worker Ant 2017-10-12 14:10:29 UTC
REVIEW: https://review.gluster.org/18476 (gfapi: free xlator_cmdline_option_t when set through glfs_set_xlator_option()) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 19 Worker Ant 2017-10-13 16:29:47 UTC
COMMIT: https://review.gluster.org/18476 committed in master by Jeff Darcy (jeff.us) 
------
commit 9f7bd36edf3f0a9c634db019d28335f4320ad41e
Author: Niels de Vos <ndevos>
Date:   Tue Oct 10 13:51:46 2017 +0200

    gfapi: free xlator_cmdline_option_t when set through glfs_set_xlator_option()
    
    Change-Id: I10c323477534fd50d29460cf71c246378659fca5
    BUG: 1443145
    Signed-off-by: Niels de Vos <ndevos>

Comment 20 Worker Ant 2017-10-13 16:33:04 UTC
COMMIT: https://review.gluster.org/18474 committed in master by Jeff Darcy (jeff.us) 
------
commit dd47c8ae6cfc9f704418cbad3e11f6aff67c4079
Author: Niels de Vos <ndevos>
Date:   Tue Oct 10 15:50:33 2017 +0200

    md-cache: free "struct mdc_conf" in fini()
    
    Change-Id: Ia3a9b0152b7e36ded584150733e8392be458125c
    BUG: 1443145
    Signed-off-by: Niels de Vos <ndevos>

Comment 21 Shyamsundar 2017-12-08 17:33:42 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.13.0, please open a new bug report.

glusterfs-3.13.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://lists.gluster.org/pipermail/announce/2017-December/000087.html
[2] https://www.gluster.org/pipermail/gluster-users/

Comment 22 Amar Tumballi 2017-12-12 05:39:06 UTC
There is more work on this.

Comment 23 Worker Ant 2017-12-13 21:08:50 UTC
COMMIT: https://review.gluster.org/17078 committed in master by \"Niels de Vos\" <ndevos> with a commit message- logging: free the strdup'd filename and ident on gf_log_fini()

Every time glfs_set_logging() is called, the strings containing the
filename and the identity of the logfile leaks. Both should be free'd
before a new gf_strdup() is done and in gf_log_fini().

In addition to the free'ing of the filename, the code has been adapted
to use sys_open() and fdopen() so that unneeded closes and re-opening of
the filedescriptor are prevented.

Change-Id: I63e3e757ac990a4db419206dfad141ab68dbfa06
BUG: 1443145
Signed-off-by: Niels de Vos <ndevos>

Comment 24 Shyamsundar 2018-03-15 11:17:12 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-4.0.0, please open a new bug report.

glusterfs-4.0.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://lists.gluster.org/pipermail/announce/2018-March/000092.html
[2] https://www.gluster.org/pipermail/gluster-users/


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