New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librados: Fix memory leak in python rados bindings #3935

Merged
2 commits merged into from Mar 16, 2015

Conversation

Projects
None yet
4 participants
@ghost

ghost commented Mar 10, 2015

A circular reference was inadvertently created when using the
CFUNCTYPE binding for callbacks for the asynchronous i/o callbacks.
This commit refactors the usage of the callbacks such that the
Ioctx object does not have a class reference to the callbacks.

Fixes: #10723
Backport: giant, firefly, dumpling
Signed-off-by: Billy Olsen billy.olsen@gmail.com
Reviewed-by: Dan Mick dmick@redhat.com
Reviewed-by: Josh Durgin jdurgin@redhat.com
(cherry picked from commit 60b019f)

Fix memory leak in python rados bindings
A circular reference was inadvertently created when using the
CFUNCTYPE binding for callbacks for the asynchronous i/o callbacks.
This commit refactors the usage of the callbacks such that the
Ioctx object does not have a class reference to the callbacks.

Fixes: #10723
Backport: giant, firefly, dumpling
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Reviewed-by: Dan Mick <dmick@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
(cherry picked from commit 60b019f)

@ghost ghost added bug fix core labels Mar 10, 2015

@ghost ghost self-assigned this Mar 10, 2015

@ghost ghost added this to the firefly milestone Mar 10, 2015

@loic-bot

This comment has been minimized.

loic-bot commented Mar 11, 2015

SUCCESS: the output of run-make-check.sh on centos-7 for d1559e7 is http://paste2.org/AzcnVCVL

:octocat: Sent from GH.

@jdurgin

This comment has been minimized.

Member

jdurgin commented Mar 12, 2015

http://tracker.ceph.com/issues/10775 should be backported at the same time as this (it fixes a bug in this patch)

rados.py: keep reference to python callbacks
If we don't keep a reference to these, the librados aio calls will
segfault since the python-level callbacks will have been garbage
collected. Passing them to aio_create_completion() does not take a
reference to them. Keep a reference in the python Completion object
associated with the request, since they need the same lifetime.

This fixes a regression from 60b019f.

Fixes: #10775
Backport: dumpling, firefly, giant
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
(cherry picked from commit 36d37aa)
@ghost

This comment has been minimized.

ghost commented Mar 12, 2015

@jdurgin thanks, the commit was added to this pull request

@loic-bot

This comment has been minimized.

loic-bot commented Mar 12, 2015

SUCCESS: the output of run-make-check.sh on centos-7 for 2bed326 is http://paste2.org/Cy7nYhjc

:octocat: Sent from GH.

@athanatos

This comment has been minimized.

Contributor

athanatos commented Mar 16, 2015

lgtm

ghost pushed a commit that referenced this pull request Mar 16, 2015

Merge pull request #3935 from dachary/wip-10723-firefly
Fix memory leak in python rados bindings

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>

@ghost ghost merged commit d434ead into ceph:firefly Mar 16, 2015

@ghost ghost changed the title from Fix memory leak in python rados bindings to python: Fix memory leak in python rados bindings Jul 14, 2015

@ghost ghost changed the title from python: Fix memory leak in python rados bindings to librados: Fix memory leak in python rados bindings Jul 14, 2015

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment