mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
s3: Use tdb_transaction_start_nonblock in gencache_stabilize
This avoids the thundering herd problem when 5000 smbds exit simultaneously because the network went down.
This commit is contained in:
parent
d5fd1f2077
commit
4d8a974ddc
@ -416,8 +416,17 @@ bool gencache_stabilize(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = tdb_transaction_start(cache);
|
res = tdb_transaction_start_nonblock(cache);
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
|
|
||||||
|
if (tdb_error(cache) == TDB_ERR_NOLOCK) {
|
||||||
|
/*
|
||||||
|
* Someone else already does the stabilize,
|
||||||
|
* this does not have to be done twice
|
||||||
|
*/
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG(10, ("Could not start transaction on gencache.tdb: "
|
DEBUG(10, ("Could not start transaction on gencache.tdb: "
|
||||||
"%s\n", tdb_errorstr(cache)));
|
"%s\n", tdb_errorstr(cache)));
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user