pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thrasher <thrasher@fibers.upc.es>
To: Berman, Phil <PBerman@northropgrumman.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Backend message type 0x50 arrived while idle
Date: Thu, 05 Dec 2002 10:27:48 +0100
Message-ID: <3DEF1C14.2000008@fibers.upc.es> (raw)
References: <99407664A0A7D511AD9900508BB0FB0301D1AEA6@XCGVA030>

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)
> 
> 




view thread (2+ messages)

Message-ID: <3DEF1C14.2000008@fibers.upc.es>
Permalink:  ../3DEF1C14.2000008@fibers.upc.es/
Also on:    postgresql.org/message-id/3DEF1C14.2000008@fibers.upc.es

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: thrasher@fibers.upc.es, PBerman@northropgrumman.com
  Subject: Re: Backend message type 0x50 arrived while idle
  In-Reply-To: <3DEF1C14.2000008@fibers.upc.es>

* 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