Description of problem:
When a volume has upcalls (features.cache-invalidation) enabled, but does not call glfs_h_poll_upcall(), the upcall events accumulate in a list that is toed to the 'struct glfs'. The application might not be interested in the events, causing the list to grow indefinitely. This manifests in some sort of memory leak.
Version-Release number of selected component (if applicable):
3.7 and upwards
Steps to Reproduce:
1. install glusterfs-coreutils and open a connection like
# gfcli glfs://localhost/test-volume
2. mount the volume over fuse
3. over fuse, create a file like
# while sleep 0.01 ; do date >> TIME ; done
4. over the glfcli, do a regular 'tail TIME'
5. in a 3rd terminal, watch 'top -p $(pidof gfcli)' increasing memory
Memory of gfcli grows slowly, but constantly.
gfcli should have stable memory usage.
Reported in relation to md-cache improvements by Poornima.
REVIEW: http://review.gluster.org/15346 (gfapi: do not cache upcalls if the application is not interested) posted (#1) for review on release-3.8 by Niels de Vos (firstname.lastname@example.org)
COMMIT: http://review.gluster.org/15346 committed in release-3.8 by Niels de Vos (email@example.com)
Author: Niels de Vos <firstname.lastname@example.org>
Date: Tue Aug 30 10:23:55 2016 +0200
gfapi: do not cache upcalls if the application is not interested
When the volume option 'features.cache-invalidation' is enabled, upcall
events are sent from the brick process to the client. Even if the client
is not interested in upcall events itself, md-cache or other xlators may
benefit from them.
By adding a new 'cache_upcalls' boolean in the 'struct glfs', we can
enable the caching of upcalls when the application called
glfs_h_poll_upcall(). NFS-Ganesha sets up a thread for handling upcalls
in the initialization phase, and calls glfs_h_poll_upcall() before any
NFS-client accesses the NFS-export.
In the future there will be a more flexible registration API for
enabling certain kind of upcall events. Until that is available, this
should work just fine.
Verificatio of this change is not trivial within our current regression
test framework. The bug report contains a description on how to reliably
reproduce the problem with the glusterfs-coreutils.
Cherry picked from commit 218c9b033fa44eacbc27d87491abd830548b362e:
> Change-Id: I818595c92db50e6e48f7bfe287ee05103a4a30a2
> BUG: 1368842
> Signed-off-by: Niels de Vos <email@example.com>
> Reviewed-on: http://review.gluster.org/15191
> Smoke: Gluster Build System <firstname.lastname@example.org>
> Reviewed-by: Poornima G <email@example.com>
> NetBSD-regression: NetBSD Build System <firstname.lastname@example.org>
> CentOS-regression: Gluster Build System <email@example.com>
> Reviewed-by: soumya k <firstname.lastname@example.org>
> Reviewed-by: Kaleb KEITHLEY <email@example.com>
Signed-off-by: Niels de Vos <firstname.lastname@example.org>
Smoke: Gluster Build System <email@example.com>
NetBSD-regression: NetBSD Build System <firstname.lastname@example.org>
CentOS-regression: Gluster Build System <email@example.com>
Reviewed-by: soumya k <firstname.lastname@example.org>
All 3.8.x bugs are now reported against version 3.8 (without .x). For more information, see http://www.gluster.org/pipermail/gluster-devel/2016-September/050859.html
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.8.4, please open a new bug report.
glusterfs-3.8.4 has been announced on the Gluster mailinglists , packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist  and the update infrastructure for your distribution.