pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Refactor script execution state machine in pgbench.
Date: Tue, 27 Sep 2016 09:38:46 +0300
Message-ID: <57d482f5-f876-3377-c516-0d1e66cc78ee@iki.fi> (raw)
In-Reply-To: <23001.1474932337@sss.pgh.pa.us>
References: <E1boQmO-0000U8-0D@gemulon.postgresql.org>
	<3089.1474920612@sss.pgh.pa.us>
	<alpine.DEB.2.20.1609262212280.28877@lancre>
	<23001.1474932337@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

On 09/27/2016 02:25 AM, Tom Lane wrote:
> Fabien COELHO <coelho@cri.ensmp.fr> writes:
>> Could you catch the process to identify the infinite loop?
>
> I think the problem is here (pgbench.c lines 4550ff):
>
>             bool        ready;
>             ...
>             ready = FD_ISSET(sock, &input_mask);
>
> The result of FD_ISSET isn't a bool, it's an int.  I can see in the
> looping process that the backend connection has socket FD 8, and
> I think what is happening is that FD_ISSET is returning 1<<8 and
> that's getting truncated to zero to fit in a bool (char), so that
> the code just below doesn't call doCustom and we never consume the
> waiting result.

Hah, good catch. It's quite a landmine that a macro named "is-something" 
doesn't return a boolean. I remember we had issues like this in some 
Postgres macros too, and added a "(<macro>) != 0)" into the macro 
definition to fix. Of course, FD_ISSET is not in our control, and "bool" 
is a Postgres thing anyway, so can't do that here.

> Will fix.

Thanks!

- Heikki



-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (8+ messages)  latest in thread

Message-ID: <57d482f5-f876-3377-c516-0d1e66cc78ee@iki.fi>
Permalink:  ../57d482f5-f876-3377-c516-0d1e66cc78ee@iki.fi/
Also on:    postgresql.org/message-id/57d482f5-f876-3377-c516-0d1e66cc78ee@iki.fi

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: hlinnaka@iki.fi, tgl@sss.pgh.pa.us, coelho@cri.ensmp.fr, heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Refactor script execution state machine in pgbench.
  In-Reply-To: <57d482f5-f876-3377-c516-0d1e66cc78ee@iki.fi>
  References: <E1boQmO-0000U8-0D@gemulon.postgresql.org> <3089.1474920612@sss.pgh.pa.us> <alpine.DEB.2.20.1609262212280.28877@lancre> <23001.1474932337@sss.pgh.pa.us> <57d482f5-f876-3377-c516-0d1e66cc78ee@iki.fi>

* 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