Postgres 7.4 : ECPG not Thread-safe

Started by Thierry Missimillyover 22 years ago5 messagesgeneral
Jump to latest
#1Thierry Missimilly
THIERRY.MISSIMILLY@BULL.NET

Hi,

This is the wrong mailing list but I don't sent it to pgsql-bugs with
success.

Attachments:

pgbch.pgctext/plain; charset=us-ascii; name=pgbch.pgcDownload+1-0
pgbch.gdbtext/plain; charset=us-ascii; name=pgbch.gdbDownload
#2Michael Meskes
meskes@postgresql.org
In reply to: Thierry Missimilly (#1)
Re: Postgres 7.4 : ECPG not Thread-safe

On Thu, Oct 09, 2003 at 04:42:18PM +0200, Thierry Missimilly wrote:

I don't know if it is really link to Postgres and ECPG but if you
modifiy pgbch.pgc in the way that the
transaction is limited to "BEGIN; END; ", it will never hang.

Do you mean it only hangs if you do automatic transaction starting? I
mean if you use PGSQL implicit transactions and explicit BEGIN...END
blocks it works well, but if you let libecpg start the transaction and
just do a COMMIT every once in a while it is not?

Well, i'm not an expert in Linux multi-thread, but it seems the thread

Neither am I, so I have no idea where to look.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

#3Bruce Momjian
bruce@momjian.us
In reply to: Michael Meskes (#2)
Re: Postgres 7.4 : ECPG not Thread-safe

I am going to see if I can reproduce the hang.

---------------------------------------------------------------------------

Michael Meskes wrote:

On Thu, Oct 09, 2003 at 04:42:18PM +0200, Thierry Missimilly wrote:

I don't know if it is really link to Postgres and ECPG but if you
modifiy pgbch.pgc in the way that the
transaction is limited to "BEGIN; END; ", it will never hang.

Do you mean it only hangs if you do automatic transaction starting? I
mean if you use PGSQL implicit transactions and explicit BEGIN...END
blocks it works well, but if you let libecpg start the transaction and
just do a COMMIT every once in a while it is not?

Well, i'm not an expert in Linux multi-thread, but it seems the thread

Neither am I, so I have no idea where to look.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Thierry Missimilly
THIERRY.MISSIMILLY@BULL.NET
In reply to: Thierry Missimilly (#1)
Re: Postgres 7.4 : ECPG not Thread-safe

Michael Meskes wrote:

On Thu, Oct 09, 2003 at 04:42:18PM +0200, Thierry Missimilly wrote:

I don't know if it is really link to Postgres and ECPG but if you
modifiy pgbch.pgc in the way that the
transaction is limited to "BEGIN; END; ", it will never hang.

Do you mean it only hangs if you do automatic transaction starting? I
mean if you use PGSQL implicit transactions and explicit BEGIN...END
blocks it works well, but if you let libecpg start the transaction and
just do a COMMIT every once in a while it is not?

Well, i'm wrong.
A pgbch (pgbench) transcation limited to :
BEGIN;
END;
Will hang too (with the same gdb stack trace), but i need to increase the
number of client to see it.

But, when the doOne() function is just doing :
for (j = 0; j < 1000000; j++) { }
pgbch never hang.
In that case, except doConnect() the lib ecpg is not used at all by the
threads.

Show quoted text

Well, i'm not an expert in Linux multi-thread, but it seems the thread

Neither am I, so I have no idea where to look.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

#5Bruce Momjian
bruce@momjian.us
In reply to: Thierry Missimilly (#1)
Re: Postgres 7.4 : ECPG not Thread-safe

Thierry Missimilly wrote:

Please enter a FULL description of your problem:
------------------------------------------------
I think i have a Thread-safe problem. PostgreSQL developpers will find a
test program to reproduce it on their lab.

I have, already sent this to pgsql-general and pgsql-hacker, but get
back not answers. But neve mind.

I've built Postgresql with the option --enable-thread-safety --with-tcl.

And now run a pgbench like program call pgbch.pgc (attached with this
mail).

The main differences of pgbch.pgc are :
1) Pro*c code
2) Multi-threaded
3) Some specific code for Oracle
4) Some specific dynamic trace for debug

I have worked with this user and found they were using EXEC SQL from
different threads, but were not using the "AT" clause to force the
threads to use their own private connection, so there was no threading
bug in our code.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073