Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters