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) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) (community) | Needs Fixing | ||
Ubuntu Core Development Team | Pending | ||
Review via email:
|
Description of the change
To post a comment you must log in.
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>: /UpdateManager. py b/UpdateManager /UpdateManager. py /UpdateManager. py /UpdateManager. py Gtk.Window) : target= self.update_ list.update, daemon=True, {'eventloop_ callback' : iterate, packages' : self.duplicate_ packages, packages' : self.ua_ security_ packages} pending( ): iteration( ) pending( ): iteration( ) list.update( callback= iterate, packages= self.duplicate_ packages, packages= self.ua_ security_ packages,
> Review: Needs Fixing
>
>
>
> Diff comments:
>
> > diff --git a/UpdateManager
> > index 7f75914..744dcdb 100644
> > --- a/UpdateManager
> > +++ b/UpdateManager
> > @@ -493,13 +490,19 @@ class UpdateManager(
> > pass
> >
> > self.update_list = UpdateList(self)
> > + t = RaisingThread(
> > + args=(self.cache,),
> > + kwargs=
> > + 'duplicate_
> > + 'ua_security_
> > + )
> > + 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_
> Gtk.main_
>
> May lead to lots of undefined behavior.
>
> > + time.sleep(0.05)
> > + while Gtk.events_
> > + Gtk.main_
> > try:
> > - self.update_
> > - self.cache,
> > - eventloop_
> > - duplicate_
> > - ua_security_
> > - )
> > + t.join()
> > except SystemError as e:
> > header = _("Could not calculate the upgrade")
> > desc = _(
>
>