Re: Statement timeout behavior in extended queries

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Tatsuo Ishii <ishii@sraoss.co.jp>
Cc: tsunakawa.takay@jp.fujitsu.com, david@fetter.org, pgsql-hackers@postgresql.org
Date: 2017-04-05T01:08:41Z
Lists: pgsql-hackers
On 2017-04-05 10:05:19 +0900, Tatsuo Ishii wrote:
> > Hm. I started to edit it, but I'm halfway coming back to my previous
> > view that this isn't necessarily ready.
> > 
> > If a client were to to prepare a large number of prepared statements
> > (i.e. a lot of parse messages), this'll only start the timeout once, at
> > the first statement sent.  It's not an issue for libpq which sends a
> > sync message after each PQprepare, nor does it look to be an issue for
> > pgjdbc based on a quick look.
> > 
> > Does anybody think there might be a driver out there that sends a bunch
> > of 'parse' messages, without syncs?
> 
> What's your point of the question? What kind of problem do you expect
> if the timeout starts only once at the first parse meesage out of
> bunch of parse messages?

It's perfectly valid to send a lot of Parse messages without
interspersed Sync or Bind/Execute message.  There'll be one timeout
covering all of those Parse messages, which can thus lead to a timeout,
even though nothing actually takes long individually.

Greetings,

Andres Freund


Commits

  1. Rearm statement_timeout after each executed query.