Skip to content
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
Merged

librados: Fix memory leak in python rados bindings #3935

2 commits merged into from Mar 16, 2015

Conversation

ghost
Copy link

@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)

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
Copy link

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

:octocat: Sent from GH.

@jdurgin
Copy link
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)

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
Copy link
Author

ghost commented Mar 12, 2015

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

@loic-bot
Copy link

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

:octocat: Sent from GH.

@athanatos
Copy link
Contributor

lgtm

ghost pushed a commit that referenced this pull request Mar 16, 2015
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 Fix memory leak in python rados bindings python: Fix memory leak in python rados bindings Jul 14, 2015
@ghost ghost changed the title python: Fix memory leak in python rados bindings librados: Fix memory leak in python rados bindings Jul 14, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants