pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Backend message type 0x50 arrived while idle
2+ messages / 2 participants
[nested] [flat]

* Backend message type 0x50 arrived while idle
@ 2002-12-03 15:47 Berman, Phil <PBerman@northropgrumman.com>
  2002-12-05 09:27 ` Re: Backend message type 0x50 arrived while idle Thrasher <thrasher@fibers.upc.es>
  0 siblings, 1 reply; 2+ messages in thread

From: Berman, Phil @ 2002-12-03 15:47 UTC (permalink / raw)
  To: pgsql-sql

To all-
I am using Postgres version 6.5.1 in a multithreaded program which is
written in C.  All inserts and updates into any tables are done within the
child process, and there are retrieves from tables both in the parent and
child processes.  Additionally, the child process will insert into and
update a table, and the parent process will retrieve from the same table.
There are loops in both the parent and child processes, so every postgres
call may be made multiple times, with a significant amount of time (seconds
or minutes) between calls.  Invariably, I get a message "backend message
type 0x50 arrived while idle" before the process completes, although the
point where I get this message can vary somewhat.  Can anyone tell me what
this message means, why I am getting it, and/or how to avoid getting it in
the future?

Thanks in advance,
Phil



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Backend message type 0x50 arrived while idle
  2002-12-03 15:47 Backend message type 0x50 arrived while idle Berman, Phil <PBerman@northropgrumman.com>
@ 2002-12-05 09:27 ` Thrasher <thrasher@fibers.upc.es>
  0 siblings, 0 replies; 2+ messages in thread

From: Thrasher @ 2002-12-05 09:27 UTC (permalink / raw)
  To: Berman, Phil <PBerman@northropgrumman.com>; +Cc: pgsql-sql

Hi Phil

It also happened to me last week. I found the problem is that you cannot 
share the same connection among processes unless you implement some kind 
of locking (semaphores, ...).

More clearly, I had this problem.

Query QA lasts 5 seconds to perform, and returns answer AA.
Query QB lasts 10 seconds and returns AB.
B is a child process of A.

I launch the parent A. Performs QA. Waits for answer.
I launch the child B. Performs QB. Waits for answer.

Server returns AA, but it gets caught by B !!

So, solutions are:
	- You open a new backend connection for each process.
	- You make each process lock before sending QA, and unlock when 
receiving AA.

Hope it helps !!

Thrasher

Berman, Phil wrote:
> To all-
> I am using Postgres version 6.5.1 in a multithreaded program which is
> written in C.  All inserts and updates into any tables are done within the
> child process, and there are retrieves from tables both in the parent and
> child processes.  Additionally, the child process will insert into and
> update a table, and the parent process will retrieve from the same table.
> There are loops in both the parent and child processes, so every postgres
> call may be made multiple times, with a significant amount of time (seconds
> or minutes) between calls.  Invariably, I get a message "backend message
> type 0x50 arrived while idle" before the process completes, although the
> point where I get this message can vary somewhat.  Can anyone tell me what
> this message means, why I am getting it, and/or how to avoid getting it in
> the future?
> 
> Thanks in advance,
> Phil
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 
> 




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-12-05 09:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-03 15:47 Backend message type 0x50 arrived while idle Berman, Phil <PBerman@northropgrumman.com>
2002-12-05 09:27 ` Thrasher <thrasher@fibers.upc.es>

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