[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7364) mdb: clean up POSIX semaphores on environment close.

h.b.furuseth@usit.uio.no wrote:
> cmikk@qwest.net writes:
>> The patch at:
>> http://mikk.net/~chris/patches/0002-Remove-POSIX-semaphores-when-the-last-user-closes-th.patch
>> Attempts to upgrade the lockfile lock to exclusive when closing the environment.
>> If that upgrade succeeds, it removes the semaphores.
> That won't help if the mdb proccess crashes.

If which process crashes? If some other process crashes then this lock will
succeed and remove the semaphores.

> Sounds like mdb needs some
> cleanup API calls.  Maybe one which does the same as your patch after
> opening the environment - except it does not create any files, and fails
> if the exclusive lock fails.

Sounds OK. Could add an invocation of it as an option for mdb_stat. mdb_stat
needs to be extended anyway.

  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/