summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Hansen <steffen@kdab.com>2006-04-30 05:09:33 (GMT)
committerSteffen Hansen <steffen@kdab.com>2006-04-30 05:09:33 (GMT)
commit45b30a996887bea380a92e11c25d04e1f0c2b129 (patch)
tree334c238c4e07a501b4f2335aae038b4f431e954e
parent09f9d12906fd24a44a7ec0289fe7924da0d56b10 (diff)
downloadperl-Kolab-2.0-stable.tar.gz
Backport of fix for bad performance on large replogs (Issue1210)2.0.42.0-stable
-rw-r--r--Kolab-LDAP-Backend-slurpd/slurpd.pm22
-rw-r--r--Makefile2
-rw-r--r--perl-kolab.spec2
3 files changed, 16 insertions, 10 deletions
diff --git a/Kolab-LDAP-Backend-slurpd/slurpd.pm b/Kolab-LDAP-Backend-slurpd/slurpd.pm
index 333afb1..d6bd14e 100644
--- a/Kolab-LDAP-Backend-slurpd/slurpd.pm
+++ b/Kolab-LDAP-Backend-slurpd/slurpd.pm
@@ -274,16 +274,23 @@ sub run
my $ready;
my $offset = 0;
- if (!($select->can_read(1)) && $changes) {
- $changes = 0;
- Kolab::log('SD', 'Change detected w/ no pending LDAP messages; reloading services if needed');
- Kolab::LDAP::sync;
- system($Kolab::config{'prefix'} . '/sbin/kolabconf');
- }
+
+ if (!($select->can_read(0)) && $changes) {
+ Kolab::log('SD', 'Change detected w/ no pending LDAP messages; waiting a second...');
+ if( !($select->can_read(1)) ) {
+ $changes = 0;
+ Kolab::log('SD', 'Change detected w/ no pending LDAP messages; reloading services if needed');
+ Kolab::LDAP::sync;
+ Kolab::log('SD', 'Running kolabconf');
+ system($Kolab::config{'prefix'} ."/sbin/kolabconf") == 0
+ or Kolab::log('SD', "Failed to run kolabconf: $?", KOLAB_ERROR);
+ Kolab::log('SD', 'Kolabconf complete');
+ }
+ }
Kolab::log('SD', 'Waiting for LDAP updates');
- for ($ready = 1; $conn && $ready; $ready = $select->can_read(1)) {
+ for ($ready = 1; $conn && $ready; $ready = $select->can_read(0)) {
Kolab::log('SD', 'Reading ASN', KOLAB_DEBUG);
my $newoffset = asn_read($conn, $pdu, $offset);
if( !$conn->connected() or $offset == $newoffset ) {
@@ -293,7 +300,6 @@ sub run
}
$offset = $newoffset;
defined($offset) or $offset = 0;
- sleep 1;
}
if ($pdu) {
diff --git a/Makefile b/Makefile
index c998557..d266d4a 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ endif
PACKAGE=perl-kolab
VERSION=0.9.2
PERLVERSION=5.8.7
-RELEASE=2.0_20051219
+RELEASE=2.0_20060430
SRCDIR=$(KOLABRPMSRC)/$(PACKAGE)
RPM = /kolab/bin/openpkg rpm
diff --git a/perl-kolab.spec b/perl-kolab.spec
index 7496914..cabcddc 100644
--- a/perl-kolab.spec
+++ b/perl-kolab.spec
@@ -48,7 +48,7 @@ Class: PLUS
Group: Language
License: GPL/Artistic
Version: %{V_perl}
-Release: 2.0_20051219
+Release: 2.0_20060430
# list of sources
Source0: http://www.cpan.org/authors/id/S/ST/STEPHANB/Kolab-%{V_kolab}.tar.gz