On 10/24/2012 05:04 PM, Simo Sorce wrote:
In sssd_nss you also need to take a F_WRLCK on the first byte of the file, however in sssd_nss case you want to retry a few times just in case you races with sss_cache. I think retrying a couple of times waiting a few milliseconds between each retry would be fine.
Say 3 retries waiting 50ms between each.
Ok. I used this for both old (to be unlinked) and new (created) memcache files. But why is F_SETLKW not sufficient here (sssd_nss)? Are you afraid of possible deadlock (it could happen if more sssd's were running at the same time, like it happened recently because of a bug with pidfile creation)? Or is there some other reason?
NOTE: This patch applies on top of the recently posted patch in (see thread: [SSSD] [PATCH] sss_cache: Multiple domains not handled properly)
I tested it and it worked well for me. Any comments appreciated.
Thanks Michal