[Pgpool-general] Fwd: PGPOOL II 2.3.3 hang in ssl mode

Tatsuo Ishii ishii at sraoss.co.jp
Wed May 19 08:51:54 UTC 2010


Thanks for the info. 

> I have changed the source pool_stream.c as follows:
> 
> #DEFINE READBUF 102400
> #DEFINE WRITEBUF 819200
> 
> It solved the previous problem.
> Now image is uploaded.

Before pgpool-II reading data from SSL layer, it checks the socket
using select(2) to see if data is avilable. Problem is, OpenSSL does
its own buffering, and it could happen that select(2) indicates
there's no data, while pending data remains in the OpenSSL's
buffer. Extending the size of pgpool-II as you did to read out all
pending data in the OpenSSL buffer might have solved part of the
problem, I suspect.

But I am not sure that solves the problem at all. Actually you still
have a problem. I will investigate the problem further, but if
somebody on this list who are really familiar with OpenSSL could help
me, I will really appreciate.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

> But it can't load in the web.
> 
> The following query runs from our application:
> 
> SELECT p.proname,p.oid  FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace
> n  WHERE
> p.pronamespace=n.oid AND n.nspname='pg_catalog' AND ( proname = 'lo_open' or
> proname = 'lo_close' or proname = 'lo_creat' or
> proname = 'lo_unlink' or proname = 'lo_lseek' or proname = 'lo_tell' or
> proname = 'loread' or proname = 'lowrite')
> 
> 
> Pgpool II hangs at:
> 
> 2010-05-17 17:24:14 DEBUG: pid 29845: detect_error: kind: V
> 2010-05-17 17:24:14 DEBUG: pid 29845: detect_error: kind: V
> 2010-05-17 17:24:14 DEBUG: pid 29845: read_kind_from_backend: read kind from
> 0 th backend V NUM_BACKENDS: 1
> 2010-05-17 17:24:14 DEBUG: pid 29845: pool_process_query: kind from backend:
> V
> 
> At Postgresql log:
> 
> fastpath function call: "lo_open" (OID 952)
> fastpath function call: "lo_tell" (OID 958)
> fastpath function call: "lo_lseek" (OID 956)
> fastpath function call: "lo_tell" (OID 958)
> fastpath function call: "lo_lseek" (OID 956)
> fastpath function call: "lo_lseek" (OID 956)
> fastpath function call: "loread" (OID 954)
> 
> 
> Any help please how to solve it.
> 
> On Tue, May 11, 2010 at 8:15 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
> > Sean,
> >
> > It seems the problem only occurs when SSL between pgpool-II and
> > PostgreSQL enabled. Also it seems that whatever SELECT query which
> > returns non trivial amount of rows hangs.
> >
> > Any idea why the problem occurs? Running pgpool-II with debug mode
> > shows that pgpool-II hangs here:
> >
> > 2010-05-11 09:49:50 DEBUG: pid 2460: pool_process_query: kind from backend:
> > D
> > 2010-05-11 09:49:50 DEBUG: pid 2460: read_kind_from_backend: read kind from
> > 0 th backend D NUM_BACKENDS: 1
> > 2010-05-11 09:49:50 DEBUG: pid 2460: pool_process_query: kind from backend:
> > D
> > --
> > Tatsuo Ishii
> > SRA OSS, Inc. Japan
> > English: http://www.sraoss.co.jp/index_en.php
> > Japanese: http://www.sraoss.co.jp
> >
> >
> > > Addition to the above, I found that,
> > >
> > > When I use the following query it works :
> > >
> > > SELECT d.datname as "Name",
> > >        r.rolname as "Owner",
> > >        d.encoding as "Encoding"
> > > FROM pg_catalog.pg_database d
> > >   JOIN pg_catalog.pg_roles r ON d.datdba = r.oid
> > > ORDER BY 1
> > >
> > > But the following query does not work:
> > >
> > > SELECT d.datname as "Name",
> > >        r.rolname as "Owner",
> > >        pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding"
> > > FROM pg_catalog.pg_database d
> > >   JOIN pg_catalog.pg_roles r ON d.datdba = r.oid
> > > ORDER BY 1
> > >
> > > The function call "pg_catalog.pg_encoding_to_char(d.encoding)" somehow
> > makes
> > > the Pgpool hang in SSL mode.
> > >
> > > ---------- Forwarded message ----------
> > > From: AI Rumman <rummandba at gmail.com>
> > > Date: Sun, May 9, 2010 at 12:06 PM
> > > Subject: PGPOOL II 2.3.3 hang in ssl mode
> > > To: pgpool-general at pgfoundry.org
> > >
> > >
> > > I am using Pgpool II 2.3.3 with Postgresql 8.3.8.
> > >
> > > When I use command \l at postgresql client the query is working
> > perfectly.
> > >
> > > But if I used the command from pgpool II client which is connected with
> > > postgresql in ssl mode, it gets hang.
> > >
> > > Again if I use the command from pgpool II client in non-ssl mode, it
> > works
> > > fine.
> > >
> > > Any help please.
> >


More information about the Pgpool-general mailing list