Samba MySQL; working on a bug fix- tech question

Andrew Bartlett abartlet at
Thu Jan 5 05:33:48 GMT 2006

On Wed, 2006-01-04 at 21:35 -0500, dmcguire wrote:
> To all:
> Please forgive me if this is the improper forum in which to ask this 
> question.
> I'm new to fixing Samba code, but I'm trying to work through fix some 
> issues in the behavior of the MySQL back end.  Specifically, I'm trying 
> write a to fix this problem:
> Could anyone tell me what source code modules control caching code and 
> similar functions- particularly things that may have changed since 
> 3.0.20b?  I'm more than happy to do that last bit of cross-referencing 
> myself, I don't mean to get greedy.
> As I said, I'm new to this, but it seems like some sort of caching 
> problem to me.

the pdb_mysql module keeps a context pointer, which I presume contains
the current coneection to the database, in data->handle.  

It is important for performance that this handle be re-used in the
process, but it must be shutdown if the is a call to fork(), or if the
connection becomes invalid. 

The LDAP code goes to great lengths to do all this, and is worth a look.
It is a mess, but at it's core, it tries to reconnect in the case of a
socket error in the underlying search/modify/add operations.  This is
the only reliable way to tell if the connection is still there.  

If you get a 'server disconnected' in any pdb_sql operation, then the
socket should be shut down, reconnected and the operation retried.

Andrew Bartlett

Andrew Bartlett                      
Authentication Developer, Samba Team 
Student Network Administrator, Hawker College
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url :

More information about the samba-technical mailing list