tdblocks "replay cache mutex" test and monitor program

Dave Daugherty dave.daugherty at centrify.com
Tue Jul 22 21:55:50 GMT 2008


Here is a test utility that will torture/monitor named locks such as
"replay cache mutex" applied to the secrets.tdb file.

 

As I mentioned we have a customer on Solaris 10 with 400-500 Samba users
logging in every day who after over 6 months of continuous operation
suddenly had all Kerberos authentication attempts fail because it
appeared as if some process never let go of the lock.

 

This code was built most recently with a 3.0.27a code base and all
modified sources are from this.

 

If the Samba team has any interest in this utility, I can generate a
patch list instead of sending entire source files.

 

I had a previous version working against 3.0.31 code base so it ports to
there easily.

 

Dave Daugherty

Centrify

 

-------------- next part --------------
tdblocks

Program to help diagnose and resolve issues related to named mutexes applied against Samba's secrets.tdb file.
For example the named mutex "replay cache mutex" is used during kerberos authentication to lock the kerberos
library's replay cached during kerberized user authentication as part of a session setup and X message.

Usages:
    tdblocks lock <named lock>
    tdblocks query <named lock>
    tdblocks torture <named lock> <num processes> <delay factor> <crash lock holder>
    tdblocks monitor <named lock> <sleep time> <max lock time> <auto kill>

tdblocks lock

This command will attempt to apply named lock.
Here is an example of applying a "replay cache mutex" lock such as kerberos authentication would use:

  tdblocks lock "replay cache mutex"

tdblocks query

Queries the named lock to see if anyone is holding the lock and if so, print the process ID of the holder

Example:

  tdblocks query "replay cache mutex"

tdblocks torture

This is used to spawn a bunch of processs with random delays that will contend for the named lock.  
Press control-c to stop the test.

The following example will spawn 100 process with 1000 delay factor (used to count up a loop), and will delibately
crash each process that gets the lock

  tdblocks torture "replay cache mutex" 100 1000 1

tdblocks monitor

This will run until control-c is pressed, and will periodically wake up and query the named lock to see if
a process holds the lock.  It will also display how long it thinks the process has held the lock. There is
an option to kill the process if it has held it too long.

The following example will wake up every 10 seconds to queery the replay cache mutex lock and will automatically
kill any process that has held the lock for more than 1 minute.

    tdblocks monitor 'replay cache mutex' 10 30 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tdblocks1.ZIP
Type: application/x-zip-compressed
Size: 49749 bytes
Desc: tdblocks1.ZIP
Url : http://lists.samba.org/archive/samba-technical/attachments/20080722/d218ee7e/tdblocks1.bin


More information about the samba-technical mailing list