After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 563640 - In all phases before APPLICATION, consider process termination as completion
In all phases before APPLICATION, consider process termination as completion
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-08 06:12 UTC by Behdad Esfahbod
Modified: 2009-01-06 02:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch (3.75 KB, patch)
2008-12-09 23:24 UTC, Behdad Esfahbod
committed Details | Review

Description Behdad Esfahbod 2008-12-08 06:12:35 UTC
Most clients register using the session protocol.  But it's perfectly fine
    if a client simply exits upon completion, or forks and exits in the parent
    when ready.  This is indeed how we were treating phase INITIALIZATION.
    There is no reason to not treat other non-APPLICATION phases that way.
    The default clients for those phases (gnome-panel, metacity, nautilus)
    register to the session, but for example, libcanberra installed a script
    for phase DESKTOP to play login sound, and since it doesn't connect to
    the session, gnome-session was timeout'ing for that phase.
Comment 1 Behdad Esfahbod 2008-12-09 23:24:42 UTC
Created attachment 124315 [details] [review]
The patch

Oops, seems like I forgot to attach.
Comment 2 Dan Winship 2008-12-10 14:40:19 UTC
Seems reasonable. Is the change to app_registered actually needed though? It seems like it should be a no-op. (I'm guessing you added that before moving the "exited" signal handler registration inside the "if phase < ..." ?)

(Disclaimer: IANAMaintainer)
Comment 3 Behdad Esfahbod 2008-12-10 16:31:48 UTC
It's needed, in case the app that terminated was from a previous phase.  Say, a previous phase timed out, or the app had registered by other means.
Comment 4 Lucas Rocha 2008-12-20 23:04:07 UTC
The change to app_registered doesn't look right to me. What you actually want to check is whether the registered app belongs to current manager phase or not. If so, check if there are no other pending apps so that you move on to the next phase.
Comment 5 Behdad Esfahbod 2008-12-20 23:25:18 UTC
(In reply to comment #4)
> The change to app_registered doesn't look right to me. What you actually want
> to check is whether the registered app belongs to current manager phase or not.
> If so, check if there are no other pending apps so that you move on to the next
> phase.

That's exactly what my code does.  Note that the pending list only has list of pending apps for current phase.  So, if it wasn't empty before, but is empty after removing the registered app, this means it was the last pending app of the current phase.
Comment 6 Lucas Rocha 2008-12-21 23:24:19 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > The change to app_registered doesn't look right to me. What you actually want
> > to check is whether the registered app belongs to current manager phase or not.
> > If so, check if there are no other pending apps so that you move on to the next
> > phase.
> 
> That's exactly what my code does.  Note that the pending list only has list of
> pending apps for current phase.  So, if it wasn't empty before, but is empty
> after removing the registered app, this means it was the last pending app of
> the current phase.

A more explicit/correct way to do that would be to match manager->priv->phase with GsmApp's "phase" property.

Comment 7 Behdad Esfahbod 2008-12-22 05:23:35 UTC
Thinking about it again, Dan was right.  The check is not needed indeed.
Comment 8 Lucas Rocha 2009-01-06 02:14:07 UTC
Yeah, Dan is right. All handlers for exited/registered are disconnected on phase timeout. No need to check signals coming from apps from a previous phase.

Commited in trunk without the changes in app_registered. Thanks!