s3-brlock: add a minimim retry time for pending blocking locks
commit46aefa59915d2d39d46d84fac9d1e6da876acbf1
authorAndrew Tridgell <tridge@samba.org>
Sat, 6 Feb 2010 04:59:43 +0000 (5 20:59 -0800)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Apr 2010 07:39:12 +0000 (1 09:39 +0200)
treee8f7eaba270581855a54ecce1a7c29cbeb671097
parent72eab0330322677e773ea8d5ecc4ba23ab8b3257
s3-brlock: add a minimim retry time for pending blocking locks

When we are waiting on a pending byte range lock, another smbd might
exit uncleanly, and therefore not notify us of the removal of the
lock, and thus not trigger the lock to be retried.

We coped with this up to now by adding a message_send_all() in the
SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to
all smbd processes. That would generate O(N^2) work when a large
number of clients disconnected at once (such as on a network outage),
which could leave the whole system unusable for a very long time (many
minutes, or even longer).

By adding a minimum re-check time for pending byte range locks we
avoid this problem by ensuring that pending locks are retried at a
more regular interval.
(cherry picked from commit 5b398edbee672392f2cea260ab17445ecca927d7)
(cherry picked from commit aa9ab3ea57808b8e227c960b442911219405f1bf)
source3/smbd/blocking.c