Change in vdsm[master]: gluster: Temporary fix for supervdsm memory leak.

danken at redhat.com danken at redhat.com
Wed Sep 24 11:51:23 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: gluster: Temporary fix for supervdsm memory leak.
......................................................................


Patch Set 1: Code-Review-1

(4 comments)

http://gerrit.ovirt.org/#/c/33312/1/vdsm/gluster/api.py
File vdsm/gluster/api.py:

Line 204:         self.svdsmProxy.glusterVolumeRemoveBrickForce(volumeName, brickList,
Line 205:                                                       replicaCount)
Line 206: 
Line 207:     def _computeVolumeStats(self, data):
Line 208:         total = data['f_blocks'] * data['f_bsize']
keep the new function returning the same namedtuple result, so that the hack is localized.
Line 209:         free = data['f_bfree'] * data['f_bsize']
Line 210:         used = total - free
Line 211:         return {'sizeTotal': str(total),
Line 212:                 'sizeFree': str(free),


http://gerrit.ovirt.org/#/c/33312/1/vdsm/gluster/cli.py
File vdsm/gluster/cli.py:

Line 1058:         raise ge.GlusterXmlErrorException(err=[etree.tostring(xmltree)])
Line 1059: 
Line 1060: 
Line 1061: # This is a workaround for memory leak caused by the
Line 1062: # libgfapi used to get volume statistics. Memory accumulates
please add a BZ# - we should know when this can be safely removed.
Line 1063: # every time the api is invoked to avoid that, it is invoked
Line 1064: # through the script gfapi.py. This can be reverted back once
Line 1065: # the memory leak issue is fixed in libgfapi.
Line 1066: @makePublic


Line 1064: # through the script gfapi.py. This can be reverted back once
Line 1065: # the memory leak issue is fixed in libgfapi.
Line 1066: @makePublic
Line 1067: def volumeStatvfs(volumeName):
Line 1068:     script = constants.P_GFAPI_SCRIPT + "gfapi"
There's no need to move gfapi arround.

Executing

 [EXT_PYTHON, previous_location.pyc,"-v", volumeName]

should be fine. This can even be done within gfapi.py itself, so the hack is contained within one file.
Line 1069:     command = [script, "-v", volumeName]
Line 1070:     rc, out, err = utils.execCmd(command)
Line 1071:     if rc != 0:
Line 1072:         raise ge.GlfsStatvfsException(rc, out, err)


http://gerrit.ovirt.org/#/c/33312/1/vdsm/gluster/gfapi
File vdsm/gluster/gfapi:

Line 161:                             args.port, args.protocol)
Line 162:     except GlusterLibgfapiException:
Line 163:         print "Failed to retrive volume stats"
Line 164:         sys.exit(1)
Line 165:     print json.dumps({'f_blocks': res.f_blocks, 'f_bfree': res.f_bfree,
please use

 json.dumps({...}, sys.stdout)

to face the Python 3 future


-- 
To view, visit http://gerrit.ovirt.org/33312
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7079426178ce47008d9a3b83635afce98536ca34
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: Sahina Bose <sabose at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list