Skip site navigation (1) Skip section navigation (2)

Autovacuum launcher occurs error when cancelled by SIGINT

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Autovacuum launcher occurs error when cancelled by SIGINT
Date: 2017-06-21 12:15:38
Message-ID: 20170621211538.0c9eae73.nagata@sraoss.co.jp (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackers
Hi,

As I report in another thread[1], I found the autovacuum launcher occurs
the following error in PG 10 when this received SIGINT. I can repuroduce
this by pg_cancel_backend or `kill -2 <pid of autovacuum laucher>`.

2017-06-21 13:56:07.010 JST [32483] ERROR:  canceling statement due to user request
2017-06-21 13:56:08.022 JST [32483] ERROR:  can't attach the same segment more than once
2017-06-21 13:56:09.034 JST [32483] ERROR:  can't attach the same segment more than once
2017-06-21 13:56:10.045 JST [32483] ERROR:  can't attach the same segment more than once
...

This errors continue until this process is terminated or the server is restarted.

When SIGINT is issued, the process exits from the main loop and returns
to sigsetjmp, and calls dsa_attach() before entering into the loop again,
this causes the error. 

We can fix it by calling dsa_attach() before sigsetjmp. Attached is the patch. 

Regards,

[1] 
https://www.postgresql.org/message-id/20170621205657.61d90605.nagata%40sraoss.co.jp

-- 
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment: autovacuum_launcher_error.patch
Description: text/x-diff (2.0 KB)

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2017-06-21 12:20:39
Subject: Re: pg_bsd_indent 2.0 is available from git.postgresql.org
Previous:From: Yugo NagataDate: 2017-06-21 11:56:57
Subject: pg_terminate_backend can terminate background workers and autovacuum launchers

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group