Mailinglist Archive: yast-devel (144 mails)

< Previous Next >
Re: [yast-devel] Progress::New() can be called recursively now
  • From: Katarina Machalkova <kmachalkova@xxxxxxx>
  • Date: Mon, 4 Feb 2008 18:40:52 +0100
  • Message-id: <200802041840.56667.kmachalkova@xxxxxxx>

I changed the internals of Progress:: module to support multiple (nested)
invocations of Progress::New() function. The change has been submitted in
yast2-2.16.22. Here are some details about my change.

With Lada Slezak's new implementation of nested progresses on the stack,
entirely new kind of bugs surfaced ;-) so I'd like all YCP module maintainers
to read the following and check if your module is not affected by this issue
So far, yast2-network and yast2-users are ... will fix y2-network soonish.

Every series of Progress::NextStage() calls in your Read() function should be
properly terminated with Progress::Finish() after the last stage. The same
basically holds true for Write() function, but there it does not hurt so

If you fail to do so, Progress module does not clean up the stack by itself
(because it does not know that you actually want to finish).
Thus, when your Write() function wants to display a new progress, it thinks
there are some progresses on the stack, wants to be nested into existing
progress and tries to update (non-existing) progress bar. This throws a
libyui exception and causes evil red popup to appear.

I was thinking about adding some check whether progress bar WidgetExists into
the function checking whether we already have some progress running, but
that's not 100% correct solution. It just prevents libyui from throwing ex.
after an attempt to update non-existing widget. Someone/something must reset
progress counter.
An ideal candidate is Progress::Finish() - but in that case the module
maintainers must take care of proper nesting of the progresses, not
Progress.ycp module itself.
Any ideas?

(*) unfortunately, we'll probably not manage to fix for tomorrow's alpha2
\\\\\ Katarina Machalkova
\\\\\\\__o YaST developer
__\\\\\\\'/_ & hedgehog painter
< Previous Next >
Follow Ups