Re: Backporting upstream gc.collect to dnf Fedora 35+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 28, 2022 at 01:40:20PM +0200, Florian Weimer wrote:
> * Richard W. M. Jones:
> 
> > This upstream fix, which is basically a single line addition:
> >
> > https://github.com/rpm-software-management/dnf/pull/1825/files
> >
> > is very important to us because it broke livecd-creator and we're
> > trying to build live CDs on F35.  I'd like to therefore backport it to
> > dnf in Fedora 35+.
> >
> > However dnf is obviously a very important, core package, so I also
> > don't want to risk breaking things.  I believe the risk of breaking
> > things is minimal.  It might imperceptibly slow things down, worst
> > case.
> >
> > What do you think?
> 
> Isn't this a bit of a gross hack?  I mean, if the DnfSack object needs
> to be closed, should this be done explicitly?

Closing it doesn't help.  Because of circular references the objects
don't get cleaned up until the Python generational GC runs, either
because you call gc.collect() here or some unpredictable time later.

The alternative to this patch is for every caller (eg. livecd-creator
in this case) to call gc.collect(), and more importantly to _know_
that they need to call gc.collect() in order that final writes to the
disk to happen.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux