[PATCH] Re: Ldirector/MySQL -> Memory Leak

Roberto Nibali ratz at drugphish.ch
Wed Feb 14 22:33:38 GMT 2007


Gentlemen,

Happy Valentine, so don't forget your ladies!

>> 	And it works fine, but I can see that the memory used by the
>> ldirector process grows linearly, until crash the server some days
>> after...
> 
> That is certainly not good. Is there any chance that you could
> test a newer ldirectord to see if the problem has already been
> resolved? The one shipped in the linux-ha (heartbeat) 2.6.8 
> tarball should be the latest.

I was bored for a couple of minutes and very interested in my freshly 
installed Eclipse environment under Windows, so I skimmed over 
ldirectord (for some reason my mercurial in eclipse didn't work, so I 
had to download ldirectord by hand, create a temporary CVS repository 
and diff it against my local CVS :)) for a while and came up with this 
little patch as a base for further discussions. Rough changelog:

o Probable whitespace damage fix.
o s/$dbh->err/$dbh-errstr()/ to get meaningful messages for
   all DBMS instead of numbers.
o Added error handling and db handle disconnect to
   the prepare query; yes, it can fail :).
o Updated comment regarding the number of fetched rows,
   since this is not a very reliable number from my little
   experience with perl->DBI.
o Explicit finish() and disconnect() calls for the place we
   should never get to and added comment, so we know if someone
   actually hits that undesired code path.
o Added support for Oracle DBMS checking (totally untested).
o Removed old code indicating that once the rows were actually
   fetched and maybe the original thought was to compare the rows
   to some string. Nevertheless, this simplifies the code a bit
   and stresses out why the undesired code path could be hit.
o Cosmetic function calling consistency brushup.

This has received no testing, since I don't run a LVS system, however I 
believe the changes are relatively safe and straight-forward. They could 
also give a hint or even address the memory leak observed by the 
original poster.

Please review carefully and consider applying the fragments that look 
fine to you, Horms.

Best regards,
Roberto Nibali, ratz
-- 
echo 
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ldirectord_misc_sql_fixes-1.diff
Url: http://lists.graemef.net/pipermail/lvs-users/attachments/20070214/e05ccba2/attachment.pl 

Search lvs-users Archives
Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort

More information about the lvs-users mailing list