SIGALRM in autovacuum.c

Started by Bruce Momjianover 20 years ago3 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Is this correct in autovacuum.c?

pqsignal(SIGALRM, handle_sig_alarm);

Should it be SIG_IGN? I don't see autovacuum using a timer or a reason
it is calling the backend's timer routine.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#2Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#1)
Re: SIGALRM in autovacuum.c

Bruce Momjian wrote:

Is this correct in autovacuum.c?

pqsignal(SIGALRM, handle_sig_alarm);

Should it be SIG_IGN? I don't see autovacuum using a timer or a reason
it is calling the backend's timer routine.

FYI, the comment above this says:

* Set up signal handlers. We operate on databases much like a regular
* backend, so we use the same signal handling. See equivalent code in
* tcop/postgres.c.

but can you have autovacuum running as a regular backend? I didn't
think so.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: SIGALRM in autovacuum.c

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Is this correct in autovacuum.c?
pqsignal(SIGALRM, handle_sig_alarm);
Should it be SIG_IGN?

Absolutely not. autovacuum takes locks just like a backend and has to
be able to handle deadlock timeout checks.

regards, tom lane