[RFC] add a shutdown event
Pekka Paalanen
ppaalanen at gmail.com
Fri Mar 22 05:42:07 PDT 2013
On Mon, 18 Mar 2013 21:43:32 +0100
Hardening <rdp.effort at gmail.com> wrote:
> On 18/03/2013 13:48, Uli Schlachter wrote:
> > Hi,
> >
> > On 18.03.2013 00:30, Hardening wrote:
> >> On 17/03/2013 23:59, Sylvain BERTRAND wrote:
> >>> On Sun, Mar 17, 2013 at 11:32:21PM +0100, Hardening wrote:
> >>>> This patch adds a shutdow event so that clients can be notified
> >>>> when the compositor is about to exit (and potentially kill its
> >>>> child processes).
> >>>> This patch is based on gh next.
> >>>
> >>> Is the socket disconnect not enough information for the clients?
> >>>
> >> As most of the time the compositor launched all the wayland clients,
> >> they may be killed before they discover the socket has disconnected.
> >
> > I might be missing something obvious, but who kills the clients and via which
> > mechanism? The only thing that I can imagine would be SIGPIPE (if they try to
> > use their socket to weston) and that one can easily be avoided without a
> > shutdown event.
>
> I'm very sorry, i've just reread docs on process management. I thought
> child process were killed when the father dies, but they aren't. They're
> just orphaned.
>
> I still think it's a good thing for clients to know when the compositor
> is shutting down cleanly. In the present situation, we have the
> following cases:
> * the compositor crashes: from the client point of view the socket
> disconnect and it's the end of the show (at least with all actions that
> involve the compositor)
> * the compositor exits cleanly (ctrl+alt+backspace or software request):
> the client will receive series of "global_remove" events but without
> knowing if it's part of hotplug system, or if it's a clean shutdown
>
> I think explicit is better than implicit and that the clients should be
> notified of this very special event: the compositor shutdown.
I think getting global_remove on the wl_compositor would be quite a
strong indication that the compositor is going away. There's nothing
hotpluggy about wl_compositor. Another good thing about using
a well-known global like that is, that all software components can
get it on their own. They only need to instantiate a wl_compositor. And
in theory clients need to handle all globals going away, anyway.
Why would we need an event for this, again, if it does not carry
any more information than is already available?
There could be reasons, but we probably need some plans about session
saving and restoring to validate them.
Thanks,
pq
More information about the wayland-devel
mailing list