pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Kevin McKibbin <kevinmckibbin123@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: pgbench: could not connect to server: Resource temporarily unavailable
Date: Sun, 21 Aug 2022 17:48:23 -0400
Message-ID: <33898.1661118503@sss.pgh.pa.us> (raw)
In-Reply-To: <83134bb1-3a21-059f-1cd6-4997de2652b8@dunslane.net>
References: <CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com>
	<3909995.1661052002@sss.pgh.pa.us>
	<35d221aa-3da4-f744-3965-ceca7f71f4ea@dunslane.net>
	<8864.1661116501@sss.pgh.pa.us>
	<83134bb1-3a21-059f-1cd6-4997de2652b8@dunslane.net>

Andrew Dunstan <andrew@dunslane.net> writes:
> On 2022-08-21 Su 17:15, Tom Lane wrote:
>> On the whole this is smelling more like a Linux kernel bug than
>> anything else.

> *nod*

Conceivably we could work around this in libpq: on EAGAIN, just
retry the failed connect(), or maybe better to close the socket
and take it from the top with the same target server address.

On the one hand, reporting EAGAIN certainly sounds like an
invitation to do just that.  On the other hand, if the failure
is persistent then libpq is locked up in a tight loop --- and
"Insufficient entries in the routing cache" doesn't seem like a
condition that would clear immediately.

It's also pretty unclear why the kernel would want to return
EAGAIN instead of letting the nonblock connection path do the
waiting, which is why I'm suspecting a bug rather than designed
behavior.

I think I'm disinclined to install such a workaround unless we
get confirmation from some kernel hacker that it's operating
as designed and application-level retry is intended.

			regards, tom lane





view thread (27+ messages)  latest in thread

Message-ID: <33898.1661118503@sss.pgh.pa.us>
Permalink:  ../33898.1661118503@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/33898.1661118503@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@dunslane.net, kevinmckibbin123@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: pgbench: could not connect to server: Resource temporarily unavailable
  In-Reply-To: <33898.1661118503@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox