Project

General

Profile

Bug #10723

rados python binding leaks Ioctx objects

Added by Billy Olsen almost 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
librados
Target version:
-
Start date:
02/02/2015
Due date:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
giant, firefly
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

When setting up cinder with ceph, rados.Ioctx objects are leaked when creating and deleting volumes.

The problem is due to storing a reference to the callback functions __aio_safe_cb_c and __aio_complete_cb_c on the object. By storing the reference, a circular reference is inadvertently created which prevents the python garbage collector from destroying the rados.Ioctx objects that were created.

A graph of the circular reference is attached.

60b019f69aa0e39d276c669698c92fc890599f50

Ioctx-circular-dependencies.png View - circular reference graph (77.1 KB) Billy Olsen, 02/02/2015 11:31 PM

Associated revisions

Revision 60b019f6 (diff)
Added by Billy Olsen almost 4 years ago

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 <>
Reviewed-by: Dan Mick <>
Reviewed-by: Josh Durgin <>

Revision 3bab4705 (diff)
Added by Billy Olsen over 3 years ago

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 <>
Reviewed-by: Dan Mick <>
Reviewed-by: Josh Durgin <>
(cherry picked from commit 60b019f69aa0e39d276c669698c92fc890599f50)

Revision 1b5fb51a (diff)
Added by Billy Olsen over 3 years ago

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 <>
Reviewed-by: Dan Mick <>
Reviewed-by: Josh Durgin <>
(cherry picked from commit 60b019f69aa0e39d276c669698c92fc890599f50)

History

#1 Updated by Josh Durgin almost 4 years ago

  • Category set to librados
  • Status changed from New to Pending Backport
  • Backport set to giant, firefly, dumpling

Nice catch!

#2 Updated by Josh Durgin almost 4 years ago

When this is backported, the fix for http://tracker.ceph.com/issues/10775 should be as well.

#3 Updated by Loic Dachary over 3 years ago

  • Description updated (diff)

#5 Updated by Loic Dachary over 3 years ago

  • Backport changed from giant, firefly, dumpling to giant, firefly

dumpling is end of life

#6 Updated by Loic Dachary over 3 years ago

  • Description updated (diff)

#7 Updated by Loic Dachary over 3 years ago

1b5fb51 Fix memory leak in python rados bindings (in giant), 3bab470 Fix memory leak in python rados bindings (in firefly),

#8 Updated by Loic Dachary over 3 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF