[Rpm-maint] [rpm-software-management/rpm] Signal Handling (Discussion #3150)

Panu Matilainen notifications at github.com
Tue Jun 25 07:35:08 UTC 2024


Sorry for the late response.

The question is somewhat rpm version dependent: rpm versions >= 4.18 do not mess with signal delivery, but older versions indeed do due to Berkeley DB requirements. Various signals get hijacked by rpm at the time of rpmdb open, and should be returned to previous state when the db and all cursors are closed. What it comes down to is basically ensuring match iterators (mi in your example) or transaction sets linger around.

The former is best ensured by avoiding placing them in variables in the first place, eg use this instead:
`
for h in ti.dbMatch("name", "docker-ce"):
    print(h)
`

The database connection is hidden behind the ts object, it'll get garbage collected and closed when it goes out of scope but if you can manually achieve that with either `ti.closeDB()` (but then you'll need to manually reopen the db if you need it again) or just `delete ti`. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3150#discussioncomment-9868161
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/3150/comments/9868161 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240625/4660d7ac/attachment.html>


More information about the Rpm-maint mailing list