Re: POSIX shared memory redux

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: POSIX shared memory redux
Дата
Msg-id 2691.1302743383@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: POSIX shared memory redux  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> In answer to your off-list question, one of the principle ways I've
> seen fcntl() locking fall over and die is when someone removes the
> lock file.  You might think that this could be avoided by picking
> something important like pg_control as the log file, but it turns out
> that doesn't really work:

> http://0pointer.de/blog/projects/locking.html

Hm, I wasn't aware of the fact that you lose an fcntl() lock if you
close a *different* file descriptor for the same file.  My goodness,
that's horrid :-(.  It basically means that any third-party code running
in a backend could accidentally defeat the locking, and most of the time
you'd never even know it had happened ... as opposed to what would
happen if you detached from shmem for instance.  You could run with such
code for years, and probably never know why sometimes the interlock
failed to work when you needed it to.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: POSIX shared memory redux
Следующее
От: "A.M."
Дата:
Сообщение: Re: POSIX shared memory redux