Bug 42631

Summary: ListCachedUsers sometimes fails to receive a reply
Product: accountsservice Reporter: Anders Blomdell <anders.blomdell>
Component: generalAssignee: Matthias Clasen <mclasen>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: rstrode
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 26236    
Bug Blocks:    
Attachments: Patch adding retries to ListCachedUsers call
attachment-7210-0.html

Description Anders Blomdell 2011-11-05 12:05:44 UTC
Created attachment 53195 [details] [review]
Patch adding retries to ListCachedUsers call

Description of problem:

With /apps/gdm/simple-greeter/disable_user_list set to true (on a system with
many users), gdm occasionally fails with 
"ActUserManager: ListCachedUsers failed: Did not receive a reply"

Version-Release number of selected component (if applicable):

accountsservice-0.6.14

How reproducible:

Often with LDAP enabled.

Steps to Reproduce:
1. su -c "gconftool-2 --set --type boolean \
       /apps/gdm/simple-greeter/disable_user_list true" -s /bin/sh gdm
2. reboot

Actual results:

gdm login does not appear

Expected results:

gdm login should appear

Additional info:

Tests were done on a Fedora 15 machine upgraded with glib2-2.31.0 and gdm-3.2.1
It probably should be noted that the system in question has LDAP enabled, and
with the network disconnected, 5-6 retries are needed before LDAP times out and
gdm can display the login box.
Comment 1 Ray Strode [halfline] 2011-11-07 11:00:28 UTC
if we need to do retries we should do them on the daemon side and not in the library.  ListCachedUsers should be robust.

On the other hand, we should investigate why retries are needed and potentially fix the root problem.

Another thought is the ListCachedUsers call should probably have an INT_MAX timeout.
Comment 2 Anders Blomdell 2011-11-08 00:41:54 UTC
(In reply to comment #1)
> if we need to do retries we should do them on the daemon side and not in the
> library.  ListCachedUsers should be robust.
As to where this is best done, I have no preferences. I fixed it in the account manager mostly because I didn't know what other applications might use (and fail) on the same call.

> On the other hand, we should investigate why retries are needed and potentially
> fix the root problem.
The reason seems to be that LDAP does not give appropriate answers until the network is up. When the disable_user_list is false, I think I'm saved due to mounting and reading of users home directories (probably .face, etc), making things sync up.
The case of LDAP and a disconnected network cable should be considered (which gives a 2 minute timeout). Locally I have made a libnss_conditional_ldap.so.2 which short circuits ldap when not on the right network (controlled by a file in /etc/NetworkManager/dispatcher.d/, status is propagated to users by change of desktop background [which explains why I stumbled as described in https://bugzilla.gnome.org/show_bug.cgi?id=663549] :-()

> Another thought is the ListCachedUsers call should probably have an INT_MAX
> timeout.
Coupled with retries perhaps :-)

I have stated the problem and feel confident that more able people can suggest a better solution. Thanks.
Comment 3 Ray Strode [halfline] 2011-11-08 06:46:49 UTC
I don't think having it in the account manager is wrong, I just think it should be in the accounts service not the accounts service library.
Comment 4 Anders Blomdell 2011-11-08 07:23:25 UTC
If you elaborate where and how, I could give it a try.
Comment 5 GitLab Migration User 2018-08-07 09:34:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/47.
Comment 6 Anders Blomdell 2018-08-07 10:00:05 UTC
Created attachment 140996 [details]
attachment-7210-0.html

On vacation

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.