Project

General

Profile

Bug #10482

External user group refresh queries for group members twice

Added by Dominic Cleal over 6 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Authentication
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

When refreshing an external user group, it queries the auth source (i.e. LDAP) twice. You can see it here with the instrumentation added in #10406, which shows two "user_list" queries to ldap_fluff.

2015-05-12 11:51:06 [D] Refreshing external user group scientists
2015-05-12 11:51:06 [D]   CACHE (0.0ms)  SELECT "auth_sources".* FROM "auth_sources" WHERE "auth_sources"."id" = 11 LIMIT 1
2015-05-12 11:51:06 [D]   Usergroup Load (0.2ms)  SELECT "usergroups".* FROM "usergroups" WHERE "usergroups"."id" = 6 ORDER BY usergroups.name LIMIT 1
2015-05-12 11:51:06 [D]   User Load (0.2ms)  SELECT "users".* FROM "users" INNER JOIN "usergroup_members" ON "users"."id" = "usergroup_members"."member_id" WHERE "usergroup_members"."usergroup_id" = 6 AND "usergroup_members"."member_type" = 'User' ORDER BY firstname
2015-05-12 11:51:06 [D]   CACHE (0.0ms)  SELECT "external_usergroups".* FROM "external_usergroups" WHERE "external_usergroups"."usergroup_id" = 6
2015-05-12 11:51:06 [D]   CACHE (0.0ms)  SELECT "auth_sources".* FROM "auth_sources" WHERE "auth_sources"."id" = 11 LIMIT 1
2015-05-12 11:51:18 [I] Successfully decrypted field for AuthSourceLdap forumsys
2015-05-12 11:51:19 [D]   LDAP-op bind (177.7ms)  [ result=success ]
2015-05-12 11:51:19 [D]   LDAP-op search (271.5ms)  [ filter=, base= ]
2015-05-12 11:51:19 [D]   LDAP-op search (279.9ms)  [ filter=(cn=scientists), base=dc=example,dc=com ]
2015-05-12 11:51:19 [D]   LDAP-op search (271.7ms)  [ filter=(cn=scientists), base=dc=example,dc=com ]
2015-05-12 11:51:20 [D]   LDAP-op search (267.7ms)  [ filter=(|(|(objectClass=posixGroup)(objectClass=organizationalunit))(objectClass=groupOfUniqueNames)), base=ou=scientists,dc=example,dc=com ]
2015-05-12 11:51:20 [D]   LDAP user_list (1271.4ms)  [ group=scientists ]
2015-05-12 11:51:29 [I] Successfully decrypted field for AuthSourceLdap forumsys
2015-05-12 11:51:29 [D]   LDAP-op bind (185.4ms)  [ result=success ]
2015-05-12 11:51:29 [D]   LDAP-op search (268.7ms)  [ filter=, base= ]
2015-05-12 11:51:29 [D]   LDAP-op search (272.3ms)  [ filter=(cn=scientists), base=dc=example,dc=com ]
2015-05-12 11:51:30 [D]   LDAP-op search (271.9ms)  [ filter=(cn=scientists), base=dc=example,dc=com ]
2015-05-12 11:51:30 [D]   LDAP-op search (287.1ms)  [ filter=(|(|(objectClass=posixGroup)(objectClass=organizationalunit))(objectClass=groupOfUniqueNames)), base=ou=scientists,dc=example,dc=com ]
2015-05-12 11:51:30 [D]   LDAP user_list (1287.6ms)  [ group=scientists ]

Associated revisions

Revision 0fd7412f (diff)
Added by Dominic Cleal over 6 years ago

fixes #10482 - get external user group members only once during refresh

Revision 8da3be9c (diff)
Added by Dominic Cleal over 6 years ago

fixes #10482 - get external user group members only once during refresh

(cherry picked from commit 0fd7412faaa76787bf15ed1901ffc9eb4d6353fa)

History

#1 Updated by The Foreman Bot over 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2375 added
  • Pull request deleted ()

#2 Updated by Dominic Cleal over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 50

Also available in: Atom PDF