]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/rados: track completions before calling aio functions 7778/head
authorHector Martin <marcan@marcan.st>
Wed, 24 Feb 2016 14:58:32 +0000 (23:58 +0900)
committerHector Martin <marcan@marcan.st>
Wed, 24 Feb 2016 15:10:14 +0000 (00:10 +0900)
commit6e901bac3024c15c7f7d0a0e0f4c84d52ed9eec6
tree4a0698f6b6c8aafe3e58bfd71f5fb31359ff5bc7
parent3c767ab81520c73b9ffb4fface257d4b68ea4615
pybind/rados: track completions before calling aio functions

Tracking completions is critical for memory safety - if the
aio function succeeds, the completion must be tracked. However,
if a KeyboardInterrupt or similar arrives between the call and
the tracking, the completion will not be tracked.

Fix this by tracking the completion before the aio call, and
explicitly cleaning up in the failure case.

This leaves the opposite problem, where an unexpected exception
(other than simple error return from the aio function) will cause
the completion to not be freed until the Ioctx is destroyed, but
that is a relatively minor issue.

Signed-off-by: Hector Martin <marcan@marcan.st>
src/pybind/rados/rados.pyx