delayed session startup
Olivier Fourdan
fourdan at gmail.com
Sat Jul 20 21:42:55 CEST 2019
Hi Simon
On Sat, 20 Jul 2019 at 20:58, Simon Steinbeiss <simon at xfce.org> wrote:
>
> Hi everyone,
>
> wegen Florian and me started working on session a few months ago we also expected it to work that way.
> However we learned that there were two internal modes: saved sessions and the fallback session.
> Irritatingly the fallback session was the de facto standard or default that everyone used/uses who doesn't save his/her session.
>
> Now the thing about the fallback session was that it just started all applications at once, irrespective of the priority group. The reason documented in the code was that this was "merely the fallback"...
> So we dug deeper trying to understand what could be improved. One of the major limitations of not using a saved session (which always respected the priority groups) is that the unique application/process id that the session uses to identify a process to see whether it can start the next one is generated once the app is running. So at the first session start the session manager doesn't know anything about the apps apart from some metadata like start command and name. This is how it always is for the fallback session - or one should probably rename it to default session.
> So we introduced the - rather limited - version of prio groups for the default session, without being able to properly trace an app or its exact status, but at least launching programs in batches, with autostart apps from the user coming last.
>
> In theory one could probably change the approach in general and just so what the default session does "once" and then stick to that, but that would have implied even bigger code changes to something I don't know enough about (a certain type of session management also seems to have been deprecated upstream at gnome/Gtk).
>
> The idea of doing this prio groups approach was that we would reduce race conditions and indeed a few have already done away (e.h. between the panel and xfsettingsd), but I guess a few others are still out there.
> My feeling is that this may simply have been ignored in the past or maybe the impact of those races has increased with Gtk3.
>
> I hope this helped to clarify the current situation or status of session!
For first time users (and those who do not save their session, ever),
the fallback *is* the session, so calling it fallback is misleading,
I'd rather call it the “default” session.
I understand the recent changes are made to turn the “default” session
into the same sort of session as a saved one.
The problem with priority is that people expect to do what is written
on the tin, ie start and make sure all components from a given
priority are started before starting the components from a lower
priority.
For this to work, xfce4-session should wait for each component of a
given priority to register before spawning the new group - Without
such a mechanism, there is no way the priority can be guaranteed to be
respected, every component will take random time a to start, that's
unavoidable.
Of course, xfce4-session would implement some sort of timeout, to
avoid one component from stalling the entire process for too long.
Failing that, we cannot avoid the various race conditions we face now...
Cheers,
Olivier
More information about the Xfce4-dev
mailing list