Re: [Suspect SPAM] Better error messages when lacking connection slots for autovacuum workers and bgworkers

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: michael(at)paquier(dot)xyz
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [Suspect SPAM] Better error messages when lacking connection slots for autovacuum workers and bgworkers
Date: 2019-02-14 12:04:37
Message-ID: 20190214.210437.257486905.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

At Wed, 13 Feb 2019 14:13:09 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in <20190213051309(dot)GF5746(at)paquier(dot)xyz>
> Hi all,
>
> When lacking connection slots, the backend returns a simple "sorry,
> too many clients", which is something that has been tweaked by recent
> commit ea92368 for WAL senders. However, the same message would show
> up for autovacuum workers and bgworkers. Based on the way autovacuum
> workers are spawned by the launcher, and the way bgworkers are added,
> it seems that this cannot actually happen. Still, in my opinion,
> providing more context can be helpful for people trying to work on
> features related to such code so as they can get more information than
> what would normally happen for normal backends.

I agree to the distinctive messages, but the autovaccum and
bgworker cases are in a kind of internal error, and they are not
"connection"s. I feel that elog is more suitable for them.

> I am wondering as well if this could not help for issues like this
> one, which has popped out today and makes me wonder if we don't have
> race conditions with the way dynamic bgworkers are spawned:
> https://www.postgresql.org/message-id/CAONUJSM5X259vAnnwSpqu=VnRECfGSJ-CgRHyS4P5YyRVwkXsQ@mail.gmail.com
>
> There are four code paths which report the original "sorry, too many
> clients", and the one of the patch attached can easily track the
> type of connection slot used which helps for better context messages
> when a process is initialized.
> Would that be helpful for at least debugging purposes?

I agree that it is helpful. Errors with different causes ought to
show distinctive error messages.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-02-14 12:12:35 Re: pg11.1: dsa_area could not attach to segment
Previous Message Kyotaro HORIGUCHI 2019-02-14 11:41:04 Re: Cache relation sizes?