rare avl shutdown slowness (related to signal handling)

From: Qingqing Zhou <zhouqq(dot)postgres(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: rare avl shutdown slowness (related to signal handling)
Date: 2015-04-07 17:54:22
Message-ID: CAJjS0u0JQsixiFRZyVm=JXqYFi8s4KNBqAn4G27c+PT-iMuDRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am playing git tip on windows 7/32 bits, with the backend compiled
with visual studio 2005 (I know, it is very old :-( ).

I encountered avl shutdown slowness twice, last night and this
morning: after a ctrl_c is hit, wait for another 60 seconds, server
shuts down. Here is one log:

D:\pgsql\bin>postgres -D../data --log_line_prefix="%t %p"
2015-04-07 10:30:04 PDT 3148LOG: database system was shut down at
2015-04-07 10:29:24 PDT
2015-04-07 10:30:04 PDT 19548LOG: database system is ready to accept
connections
2015-04-07 10:30:04 PDT 27008LOG: autovacuum launcher started
2015-04-07 10:30:08 PDT 19548LOG: received fast shutdown request
2015-04-07 10:30:08 PDT 19548LOG: aborting any active transactions
2015-04-07 10:30:08 PDT 27008LOG: autovacuum launcher shutting down
2015-04-07 10:30:08 PDT 27008ERROR: canceling statement due to user request
2015-04-07 10:31:09 PDT 27008LOG: autovacuum launcher shutting down
2015-04-07 10:31:09 PDT 15656LOG: shutting down
2015-04-07 10:31:09 PDT 15656LOG: database system is shut down

The interesting part is on PID 27008: avl first ereport() shutdown,
which is at the very end of the main loop and just one step away from
proc_exit(). Then it seems honors a SIGINT within ereport(), longjmp
to the loop head, and waits for another 60 seconds. After timeout, it
ereports shutdown again, and finally exits.

Not sure if this is windows only or general. I can hardly repro it.
Anyone has ever seen this?

Regards,
Qingqing

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-04-07 18:19:15 Re: Support UPDATE table SET(*)=...
Previous Message Sawada Masahiko 2015-04-07 16:57:35 Re: Proposal : REINDEX xxx VERBOSE