when trying to reset student passwords as a teacher and choosing the right class the UMC takes very long to show the search result of the students in said class. Background: every user in the ldap is searched for name, surname, class, etc. before narrowing this down to the class at hand and displaying the result. example: school environment with 10 schools, 20 classes each and 5000 students/teachers teacher tries to reset password of "anton a" in class "12b" of school "gesamtschule 2" - he starts "password reset (students) module" (and has hopefully autosearch off!), chooses the class and waits around 5 minutes till the UMC shows him the 20 results.
(In reply to Jens Thorp-Hansen from comment #0) > Background: every user in the ldap is searched for name, > surname, class, etc. before narrowing this down to the class at hand and > displaying the result. In this case every student is opened in SchoolBaseModule._users() and afterwards the opened user objects are matched against the given group → all user objects that are not group member are dropped immediately → a lot of useless LDAP requests.
The code has been optimized: If _users() is called and a group has been specified, only the DNs of the group members are tried to open. In my test environment this reduces the response time of "query" for the "password (students)" module from ~1700ms down to ~180ms (264 UCS@school users total in LDAP; group contains 26 users; timing is average over 5 measurements). ucs-school-lib.yaml: r72015 | Bug #42167: improve inefficient code of SchoolBaseModule._users() to speed up user search if a group has been specified ucs-school-lib (9.0.22-1): r72015 | Bug #42167: improve inefficient code of SchoolBaseModule._users() to speed up user search if a group has been specified
Created attachment 7943 [details] Extracted patch as hotfix (NOT TESTED BY QA!) patch -d /usr/share/pyshared/ucsschool/lib --backup < bug42167c.patch The patch has NOT been tested by QA yet!
Created attachment 7944 [details] patch Even more efficient is to specifiy the pattern as filter instead of evaluating this after opening the object.
Created attachment 7945 [details] patch
* UCSSchoolHelperAbstractClass.get_only_udm_obj() now supports an optional search base as argument * last change was not optimal ==> LDAP search patterns are now evaluated by the LDAP server before opening/retrieving the UDM object * changes in LDAP_Filter have been reverted ucs-school-lib (9.0.23-1): r72125 | Bug #42167: added changelog entry r72124 | Bug #42167: get UDM objects directly and filter via LDAP search filter r72123 | Bug #42167: allow to define an optional search base in get_only_udm_obj() r72122 | Bug #42167: revert changes from last commit in class LDAP_Filter ucs-school-lib.yaml: r72126 | Bug #42167: updated advisory Package: ucs-school-lib Version: 9.0.23-1.256.201608311408
OK: changes OK: YAML
UCS@school 4.1 R2 v5 has been released. http://docs.software-univention.de/changelog-ucsschool-4.1R2v5-de.html If this error occurs again, please clone this bug.