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)
commitab8d41053347a5b342ed5b59a0b0dd4983ca91e6
tree0521b5b4783c3ec5839c728218f317468c977b2c
parent668b278653acfc4de7807834988f7af557e608a5
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.
source/libsmb/trustdom_cache.c