Re: What happens if the socket lock file is deleted?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "stevej(at)stevej(dot)name" <stevej(at)stevej(dot)name>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: What happens if the socket lock file is deleted?
Date: 2026-01-30 00:14:28
Message-ID: 7c857e55-de24-4b3b-ba7b-7116648119ac@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/29/26 13:24, Tom Lane wrote:
> Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
>> From here at ~line 1781:
>
>> https://github.com/postgres/postgres/blob/master/src/backend/postmaster/postmaster.c
>
>> /*
>> * Once a minute, verify that postmaster.pid hasn't been removed or
>> * overwritten. If it has, we force a shutdown.
>
> Actually, Steve was asking about socket lock files, so the relevant
> code fragment is the bit just below that:

Aah, I was close but no cigar.

Well at least I learned something.

>
> /*
> * Touch Unix socket and lock files every 58 minutes, to ensure that
> * they are not removed by overzealous /tmp-cleaning tasks. We assume
> * no one runs cleaners with cutoff times of less than an hour ...
> */
> if (now - last_touch_time >= 58 * SECS_PER_MINUTE)
> {
> TouchSocketFiles();
> TouchSocketLockFiles();
> last_touch_time = now;
> }
>
> regards, tom lane

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2026-01-30 00:22:15 Re: What happens if the socket lock file is deleted?
Previous Message Tom Lane 2026-01-29 21:24:39 Re: What happens if the socket lock file is deleted?