Merge ~nteodosio/update-manager:calculation-hang into update-manager:main

Proposed by Nathan Teodosio
Status: Work in progress
Proposed branch: ~nteodosio/update-manager:calculation-hang
Merge into: update-manager:main
Diff against target: 96 lines (+34/-10)
3 files modified
UpdateManager/Core/utils.py (+15/-0)
UpdateManager/UpdateManager.py (+13/-10)
debian/changelog (+6/-0)
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) (community) Needs Fixing
Ubuntu Core Development Team Pending
Review via email: mp+470889@code.qastaging.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Needs Fixing
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Yeah, this was submitted before I fixed that bug by actually removing the main
iteration loop, I'll work on removing it here too.

Am 07/10/2024 um 13:48 schrieb <email address hidden>:
> Review: Needs Fixing
>
>
>
> Diff comments:
>
> > diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
> > index 7f75914..744dcdb 100644
> > --- a/UpdateManager/UpdateManager.py
> > +++ b/UpdateManager/UpdateManager.py
> > @@ -493,13 +490,19 @@ class UpdateManager(Gtk.Window):
> > pass
> >
> > self.update_list = UpdateList(self)
> > + t = RaisingThread(target=self.update_list.update, daemon=True,
> > + args=(self.cache,),
> > + kwargs={'eventloop_callback': iterate,
> > + 'duplicate_packages': self.duplicate_packages,
> > + 'ua_security_packages': self.ua_security_packages}
> > + )
> > + t.start()
> > + while t.is_alive():
>
> Using GTask-like implementation would be better, because we need to be
> signaled when the thread finishes, and not use the same thing that we were
> removing in a similar fix, by just waiting.
>
> As doing:
>
> while Gtk.events_pending():
> Gtk.main_iteration()
>
> May lead to lots of undefined behavior.
>
> > + time.sleep(0.05)
> > + while Gtk.events_pending():
> > + Gtk.main_iteration()
> > try:
> > - self.update_list.update(
> > - self.cache,
> > - eventloop_callback=iterate,
> > - duplicate_packages=self.duplicate_packages,
> > - ua_security_packages=self.ua_security_packages,
> > - )
> > + t.join()
> > except SystemError as e:
> > header = _("Could not calculate the upgrade")
> > desc = _(
>
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches