#2802: GTKUI shutdown procedure is broken
--------------------+---------------------------
Reporter: bro | Owner: bro
Type: bug | Status: new
Priority: major | Milestone: 2.0
Component: GTK-UI | Version: develop (git)
Keywords: |
--------------------+---------------------------
In thin client mode, the shutdown routine does not have to do much, but in
classic mode, all the components have to be shut down properly before
closing.
There are two separate issues as far as I've found.
== GTKUI component shutdown after reactor is stopped ==
When closing GTKUI main window ([[https://github.com/deluge-
torrent/deluge/blob/e468436b0c90b53fe5bd9dd910a3847bf901e9e6/deluge/ui/gtkui/mainwindow.py#L227|mainwindow.py#L227]]
) the reactor is stopped.
The result is that this call to `reactor.run()` returns:
[[https://github.com/deluge-
torrent/deluge/blob/e468436b0c90b53fe5bd9dd910a3847bf901e9e6/deluge/ui/gtkui/gtkui.py#L246|gtkui.py#L246]]
The call to `self.shutdown()` on the next line ([[https://github.com
/deluge-
torrent/deluge/blob/e468436b0c90b53fe5bd9dd910a3847bf901e9e6/deluge/ui/gtkui/gtkui.py#L246|gtkui.py#L247]])
in turn calls `component.stop()` and `component.shutdown()`, which is
completely broken, as the reactor is no longer running which means async
events like deferreds cannot be processed.
The reason the shutdown procedure in classic mode works anyways as that
the daemon has `addSystemEventTrigger("before", "shutdown",
self._shutdown)` which calls `component.shutdown()`:
[[https://github.com/deluge-
torrent/deluge/blob/e468436b0c90b53fe5bd9dd910a3847bf901e9e6/deluge/core/daemon.py#L155|daemon.py#L155]]
== SIGINT stops reactor breaking components shutdown ==
Running GTKUI in terminal and trying to close with CTRL-C does not work
very good. The process hangs and needs multiple signals to close, and
sometimes doesn't even close at all and needs explicit call to kill.
The problem is that the reactor closes (`reactor.run()` ends) resulting in
deferreds from `component.close`/`component.shutdown` call not being
fired.
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2802>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.