[PATCH 1/3] Move HW errors processing to the code that runs in the main thread

Brian C. Lane bcl at redhat.com
Mon Jan 12 18:49:25 UTC 2015


On Mon, Jan 12, 2015 at 03:04:42PM +0100, Vratislav Podzimek wrote:
> Also rename the run_handleException function to main_thread_handleException
> which better explains its purpose.
> 
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  pyanaconda/exception.py | 149 ++++++++++++++++++++++++------------------------
>  1 file changed, 75 insertions(+), 74 deletions(-)

Something I ran into on Friday that this doesn't address is error
handling in cmdline mode. In commit 8c5d7c9f you stopped setting up the
handler when we're in cmdline mode which fixed that specific bug, but
introduced another problem with errors that happen in the tui input
thread. If there is an incomplete spoke it raises an error, which passes
it to the main loop where the system handles it by printing it. And back
in the thread it loops and raises again, and again, etc. nothing ever
exits so it's stuck.

I think we need to always have the handler installed, but need to handle
problems like 1155979 by telling meh we're not interactive and it should
just quit instead of trying to get user input.

> +        except (RuntimeError, ImportError):
> +            log.debug("Gtk cannot be initialized")
> +            # X not running (Gtk cannot be initialized)
> +            if threadMgr.in_main_thread():
> +                log.debug("In the main thread, running exception handler")
> +                if (issubclass (ty, CmdlineError)):
> +
> +                    cmdline_error_msg = _("\nThe installation was stopped due to "

May as well remove that blank line while you're at it.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list