Description of problem: Not sure if this is a dnf issue or father down, but: #!/usr/bin/python3 import dnf import psutil proc = psutil.Process() base = dnf.Base() base.conf.assumeyes = True base.conf.read() for i in [1, 2, 3]: base.fill_sack(load_system_repo='auto') base.close() print(proc.open_files()) produces: [popenfile(path='/var/lib/sss/mc/passwd', fd=3, position=0, mode='r', flags=557056), popenfile(path='/var/lib/sss/mc/group', fd=5, position=0, mode='r', flags=557056), popenfile(path='/var/tmp/dnf-orion-admin-75jop0p2/hawkey.log', fd=6, position=4834, mode='a', flags=33793)] [popenfile(path='/var/lib/sss/mc/passwd', fd=3, position=0, mode='r', flags=557056), popenfile(path='/var/lib/sss/mc/group', fd=5, position=0, mode='r', flags=557056), popenfile(path='/var/tmp/dnf-orion-admin-75jop0p2/hawkey.log', fd=6, position=4880, mode='a', flags=33793), popenfile(path='/var/tmp/dnf-orion-admin-75jop0p2/hawkey.log', fd=7, position=4968, mode='a', flags=33793)] [popenfile(path='/var/lib/sss/mc/passwd', fd=3, position=0, mode='r', flags=557056), popenfile(path='/var/lib/sss/mc/group', fd=5, position=0, mode='r', flags=557056), popenfile(path='/var/tmp/dnf-orion-admin-75jop0p2/hawkey.log', fd=6, position=4880, mode='a', flags=33793), popenfile(path='/var/tmp/dnf-orion-admin-75jop0p2/hawkey.log', fd=7, position=5014, mode='a', flags=33793), popenfile(path='/var/tmp/dnf-orion-admin-75jop0p2/hawkey.log', fd=8, position=5102, mode='a', flags=33793)] Note the multiple open files of hawkey.log. Version-Release number of selected component (if applicable): python3-dnf-2.7.5-12.fc28.noarch Related see https://github.com/ansible/ansible/pull/41810
Hi there, This problem seems to be due to 'self._sack = None' in 'def reset()' being insufficient to clear out the last reference to the Sack, causing tp_dealloc() to call hy_sack_free() and subsequently close the file descriptor. Triggering a manual 'gc.collection()' suggests the problem is also unrelated to a reference cycle within the graph of the Sack object itself, unless it has a missing or buggy tp_traverse implementation. Please expose an explicit close() method on the Sack object, the existing API is unsafe as it conflates memory management and resource finalization, which always leads to fragile and surprising results Related digging: https://github.com/dw/mitogen/issues/280#issuecomment-399307248
This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '28'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 28 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Still present with python3-dnf-4.2.5-1.fc29.noarch
I created a patch: https://github.com/rpm-software-management/libdnf/pull/792
Fixed in Fedora 30 - dnf-4.2.11