Re: [Kolab-devel] Upgrade report 3.1 to 3.2 on Debian Wheezy

Paul Boddie <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab
Message-ID <[email protected]>
On Saturday 15. February 2014 20.56.01 Paul Boddie wrote:
> On Saturday 15. February 2014 19.27.52 Tobias Brunner wrote:
> > I was brave enough to upgrade from 3.1 to 3.2 on Debian Wheezy. Here is
> > my experience:
> > 
> > kolabd 100% CPU
> > ---------------
> > Since the upgrade the process "/usr/bin/python /usr/sbin/kolabd -l
> > warning --fork --user kolab --pid-file /run/kolabd/kolabd.pid" is
> > running with 100% CPU. Could not find a log giving hints on what's going
> > wrong. strace does also not give any usable hints.
> 
> This sounds somewhat familiar. Since kolabd's job is to synchronise the
> IMAP and LDAP components, if I remember correctly, any failure with either
> of those may cause kolabd to "busy loop". I seem to remember this
> happening a few months ago before I managed to get the configuration
> sorted out.

Well, I was sort of correct here, but the actual cause surprised me somewhat:

http://git.kolab.org/pykolab/tree/kolabd/__init__.py#n223

In effect, the LDAP connection loop can never terminate because it will never 
get a true value from the connect method being called. I've attached a patch 
that should fix this, and it seems to have worked for me.

There are also some other problems that may need patching...

A missing definition for delivery_address_attribute in the 
_change_none_sharedfolder method of the pykolab.auth.ldap.LDAP class:

http://git.kolab.org/pykolab/tree/pykolab/auth/ldap/__init__.py#n1728

It presumably needs to be set as follows before being used:

delivery_address_attribute = \
  self.config_get('sharedfolder_delivery_address_attribute')

Missing initialisation of the configuration object:

http://git.kolab.org/pykolab/tree/pykolab/conf/__init__.py#n448

I've attached a patch for this, but due to differences between my fork of 
pykolab and the upstream version, the line numbers may need adjusting.

I did also see the reported heavy usage of various translation-related files, 
or at least when I interrupted kolabd one time, the traceback I got (by 
modifying the code) showed some activity in that department. That may have 
been a side-effect of the other issues, however.

Anyway, I hope these findings are helpful.

Paul

P.S. If the patches get stripped by the mailing list, I'll happily send them 
to anyone or put them somewhere online.

_______________________________________________
devel mailing list
[email protected]
https://lists.kolab.org/mailman/listinfo/devel
fix-ldap-infinite-loop.diff (text/x-patch, 924 B)
commit b64da41db062ebdbaa39cad5be6f5221030e8249
Author: Paul Boddie <[email protected]>
Date:   Sat Feb 15 23:34:09 2014 +0100

    Fixed infinite LDAP connection loop.

diff --git a/kolabd/__init__.py b/kolabd/__init__.py
index 868e8b7..5a1dc56 100644
--- a/kolabd/__init__.py
+++ b/kolabd/__init__.py
@@ -220,14 +220,14 @@ class KolabDaemon(object):
         while 1:
             primary_auth = Auth(primary_domain)
 
-            connected = False
-            while not connected:
+            while 1:
                 try:
-                    connected = primary_auth.connect()
+                    primary_auth.connect()
                 except Exception, errmsg:
-                    connected = False
                     log.error(_("Could not connect to LDAP, is it running?"))
                     time.sleep(5)
+		else:
+                    break
 
             log.debug(_("Listing domains..."), level=5)
fix-config-initialisation.diff (text/x-patch, 842 B)
commit e47726cb2c80bc453053c260f7a2dde4e2ac564b
Author: Paul Boddie <[email protected]>
Date:   Sat Feb 15 23:34:59 2014 +0100

    Added missing initialisation operations.

diff --git a/pykolab/conf/__init__.py b/pykolab/conf/__init__.py
index 353159c..3de663d 100644
--- a/pykolab/conf/__init__.py
+++ b/pykolab/conf/__init__.py
@@ -459,11 +459,15 @@ class Conf(object):
             setattr(self,option,self.cli_parser.defaults[option])
 
     def has_section(self, section):
-        self.read_config()
+        if not self.cfg_parser:
+            self.read_config()
 
         return self.cfg_parser.has_section(section)
 
     def has_option(self, section, option):
+        if not self.cfg_parser:
+            self.read_config()
+
         return self.cfg_parser.has_option(section, option)
 
     def get_list(self, section, key):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.