[PATCH] Fix a race condition with kickstarts (#868834)

Vratislav Podzimek vpodzime at redhat.com
Fri Oct 26 08:25:19 UTC 2012


On Thu, 2012-10-25 at 20:40 -0700, Jesse Keating wrote:
> We were simluating the continue click before consuming all the messages
> in the queue, which would cause the next hub to be in use, but we were
> attempting to process messages for the previous hub.  It would cause a
> crash of anaconda, but not a backtrace that could be caught with our
> autoreporter.  The solution is to only continue when the queue is empty.
It is not a crash, it just hits the place in
pyanaconda/ui/gui/__init__.py:GraphicalUserInterface._on_continue_clicked which calls sys.exit(0). See my patch from Tuesday which I think should also be applied together with this one. However this patch looks to me as a nice solution for an awkward problem. Just please see one comment below.

> 
> This also makes use of a property to see if we are ready to continue
> instead of duplicating code.
> ---
>  pyanaconda/ui/gui/hubs/__init__.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
> index 13f6192..3a88cc3 100644
> --- a/pyanaconda/ui/gui/hubs/__init__.py
> +++ b/pyanaconda/ui/gui/hubs/__init__.py
> @@ -278,11 +278,12 @@ class Hub(GUIObject, common.Hub):
>                      if not args[1]:
>                          spoke.execute()
>  
> -                    if len(self._incompleteSpokes) == 0 and len(self._notReadySpokes) == 0:
> +                    if self.continuePossible:
>                          if self._inSpoke:
>                              self._autoContinue = True
>                          else:
> -                            self.continueButton.emit("clicked")
> +                            if q.empty():
> +                                self.continueButton.emit("clicked")
The else-if could be replaced with:

elif q.empty():
    self.continueButton.emit("clicked")

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list