r20690: fix a bug that causes smbd to 'hang' intermittently.
authorAndrew Tridgell <tridge@samba.org>
Thu, 11 Jan 2007 23:10:16 +0000 (23:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:17:02 +0000 (12:17 -0500)
commitfc8605735470df188a2915b6109c1c01a20bc6ac
tree1cc298c5456af4c29c59cef3aaa647af0ed2447c
parent0d538f7370f13b175f127f061d5bff18e631cd5e
r20690: fix a bug that causes smbd to 'hang' intermittently.

The problem occurs like this:

  1) running smbd as a domain member without winbindd

  2) client1 connects, during auth smbd-1 calls update_trustdom_cache()

  3) smbd-1 takes the trustdom cache timestamp lock, then starts
     enumerate_domain_trusts

  4) enumerate_domain_trusts hangs for some unknown reason

  5) other clients connect, all block waiting for read lock on trustdom
     cache

  6) samba is now hung

The problem is the lock, and really its just trying to avoid a race
where the cure is worse than the problem. A race in updating the
trutdom cache is not a big issue. So I've just removed the lock.

It is still an open question why enumerate_domain_trusts() can
hang. Unfortunately I've not in a position to get a sniff at the site
that is affected. I suspect a full fix will involve ensuring that all
the rpc code paths have appropriate timeouts.
(This used to be commit ab8d41053347a5b342ed5b59a0b0dd4983ca91e6)
source3/libsmb/trustdom_cache.c