While I think the code is insanely clever, and I'm quite pleased
that rpm is surviving as well as it is in spite of unanticipated
and bizzarre uses of the implementation, the code is solving
entirely the wrong problem, and triggering a lot of instability.
I don't quite see that this code is a problem. It only runs at
task time
(not at signal time), when the object is being reclaimed by the Python
interpreter. It should be like any other call to close the
database. It
can't happen inside a call to rpmlib (unless there is more than one
thread). Am I misunderstanding the issue?