--- accountsservice-0.6.14.orig/src/libaccountsservice/act-user-manager.c 2011-09-04 16:22:06.000000000 +0200 +++ accountsservice-0.6.14/src/libaccountsservice/act-user-manager.c 2011-11-02 13:40:12.141589894 +0100 @@ -62,6 +62,8 @@ #define ACCOUNTS_PATH "/org/freedesktop/Accounts" #define ACCOUNTS_INTERFACE "org.freedesktop.Accounts" +#define LOAD_USERS_MAX_RETRIES 10 + typedef enum { ACT_USER_MANAGER_SEAT_STATE_UNLOADED = 0, ACT_USER_MANAGER_SEAT_STATE_GET_SESSION_ID, @@ -150,7 +152,7 @@ gboolean is_loaded; gboolean has_multiple_users; - gboolean listing_cached_users; + guint load_users_retry; }; enum { @@ -177,6 +179,7 @@ static void load_seat_incrementally (ActUserManager *manager); static void unload_seat (ActUserManager *manager); +static void load_users_retry (ActUserManager *manager); static void load_users (ActUserManager *manager); static void act_user_manager_queue_load (ActUserManager *manager); static void queue_load_seat_and_users (ActUserManager *manager); @@ -1193,7 +1196,6 @@ GError *error = NULL; GPtrArray *paths; - manager->priv->listing_cached_users = FALSE; if (!dbus_g_proxy_end_call (proxy, call_id, &error, @@ -1202,11 +1204,11 @@ g_debug ("ActUserManager: ListCachedUsers failed: %s", error->message); g_error_free (error); - g_object_unref (manager->priv->accounts_proxy); - manager->priv->accounts_proxy = NULL; - + load_users_retry(manager); return; } + + manager->priv->load_users_retry = 0; /* We now have a batch of unloaded users that we know about. Once that initial * batch is loaded up, we can mark the manager as loaded. @@ -1799,7 +1801,7 @@ return; } - if (manager->priv->listing_cached_users) { + if (manager->priv->load_users_retry) { g_debug ("ActUserManager: Listing cached users, so not setting loaded property"); return; } @@ -1924,18 +1926,32 @@ } static void -load_users (ActUserManager *manager) +load_users_retry (ActUserManager *manager) { g_assert (manager->priv->accounts_proxy != NULL); - g_debug ("ActUserManager: calling 'ListCachedUsers'"); - dbus_g_proxy_begin_call (manager->priv->accounts_proxy, - "ListCachedUsers", - on_list_cached_users_finished, - manager, - NULL, - G_TYPE_INVALID); - manager->priv->listing_cached_users = TRUE; + if (manager->priv->load_users_retry < LOAD_USERS_MAX_RETRIES) { + g_debug ("ActUserManager: calling 'ListCachedUsers' (retry=%d)", + manager->priv->load_users_retry); + manager->priv->load_users_retry++; + dbus_g_proxy_begin_call (manager->priv->accounts_proxy, + "ListCachedUsers", + on_list_cached_users_finished, + manager, + NULL, + G_TYPE_INVALID); + } else { + g_debug ("ActUserManager: 'ListCachedUsers' giving up"); + g_object_unref (manager->priv->accounts_proxy); + manager->priv->accounts_proxy = NULL; + } +} + +static void +load_users (ActUserManager *manager) +{ + manager->priv->load_users_retry = 1; + load_users_retry(manager); } static void