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.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
REVIEW: https://review.gluster.org/18478 (rpc: free registered callback programs) posted (#1) for review on master by Niels de Vos (ndevos)
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)
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>
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>
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>
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)
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>
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>
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/
There is more work on this.
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>
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/