Dynamic Background Workers and clean exit

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Dynamic Background Workers and clean exit
Date: 2014-04-16 09:27:41
Message-ID: 534E4D0D.5090908@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I've been recently doing some work with dynamic bgworkers and noticed
that I have no way of saying "I am done now and want to exit cleanly"
because bgworkers get restarted automatically on exit code 0 no matter
what is the restart interval set to.

I understand the rationale for this behavior when using static bgworkers
which are meant to run forever, but dynamic ones are spawned dynamically
by code so they should also be able to terminate cleanly as they have
presumably finite work to do. Also I think the clean shutdown of dynamic
bgworker should not be logged (or at least not with the same log level
as it is now) since it's business as usual.

Since the dyanamic bgworkers are new in 9.4 the behavior can still be
changed.

Thoughts?

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-04-16 09:57:54 Re: Clock sweep not caching enough B-Tree leaf pages?
Previous Message Andres Freund 2014-04-16 09:18:52 Re: Clock sweep not caching enough B-Tree leaf pages?