• Alvaro Herrera's avatar
    Fix autovacuum launcher shutdown sequence · 5df64f29
    Alvaro Herrera authored
    It was previously possible to have the launcher re-execute its main loop
    before shutting down if some other signal was received or an error
    occurred after getting SIGTERM, as reported by Qingqing Zhou.
    
    While investigating, Tom Lane further noticed that if autovacuum had
    been disabled in the config file, it would misbehave by trying to start
    a new worker instead of bailing out immediately -- it would consider
    itself as invoked in emergency mode.
    
    Fix both problems by checking the shutdown flag in a few more places.
    These problems have existed since autovacuum was introduced, so
    backpatch all the way back.
    5df64f29
autovacuum.c 86.1 KB