[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Question on chasing referrals
- To: openldap-devel@openldap.org
- Subject: Question on chasing referrals
- From: "Lucas C. Villa Real" <lucasvr@gobolinux.org>
- Date: Wed, 22 Sep 2010 15:09:42 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=mWiYmpPbOnmcX6hxeN22XKnpX4TYKLW5Ywq1YrtLvnQ=; b=MCXqwdkRA5fsG2E/ABEQIh+nZEZI2pbxGr4Ey+4EevlDHeM9KZTFiMSOptE4A8ZwL6 ZRLrBWCLB2QexcGtk+pB0tvMsmYnIzd0dgcI4xHOf7UuPDP+xdKh/EA/viiS/dAPV3Ds skMoU2OEpmK/KuPySH/GcSPLlc3aG7KFKkVO8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=J/LfgY9GV2qVtuegAnsEj812NMVJJJ/MdynnjJMcGoXJP/iKt+cIraB6AGVblevo1G mXIdmZ0jU8NvzO2W4MXKifvLmCrgX/e535ZktCI4IiCePMcJK3wdjpLs0dB8axzBBQQR LJHsKF+6Nbg6zZb3Pd65yiTk8zesucStzRpUI=
Hello folks,
We have been running openldap-2.3.32 on SLES64 for a while with no problem.
However, recently a couple of packages were upgraded (not including
openldap), and we noticed that some applications started to consume
100% of CPU in a loop that never ended. After doing some investigation
we found that it was due to a bug in a list traversal of OpenLDAP that
had been fixed in mainline already. This is the patch in question,
which was introduced in the commit referenced at the end of the email
[1]:
--- openldap-2.3.32/libraries/libldap/request.c.orig 2010-05-27
02:22:38.000000000 +0200
+++ openldap-2.3.32/libraries/libldap/request.c 2010-05-27
02:22:50.000000000 +0200
@@ -916,7 +916,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRe
if ( lp == origreq ) {
lp = lp->lr_child;
} else {
- lp = lr->lr_refnext;
+ lp = lp->lr_refnext;
}
}
if ( looped ) {
So, these apps probably started to interact differently with OpenLDAP.
The thing is that now these applications are taking much more time to
complete execution than before. As a simple test, I tried to replace
the above fix with a call to "break", which would mimic the old
behavior back when applications didn't execute that code path:
} else {
- lp = lr->lr_refnext;
+ break;
}
To my surprise, the execution time of those apps went back to normal.
Since I don't have experience with OpenLDAP nor I have a good
understanding on many of its concepts, I'd like to ask you what's the
impact on not chasing all referrals from the linked list? I read in
the comments of try_read1msg() that if chasing fails then the referral
is passed back to the application. Can I assume that try_read1msg() is
basically caching that information just in case the caller needs it?
What is that chasing used for?
Thank you very much!
Lucas
[1] http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/request.c.diff?r1=1.125.2.5&r2=1.125.2.6&cvsroot=OpenLDAP-src&hideattic=1&sortbydate=0