Re: Backend message type 0x50 arrived while idle

From: Thrasher <thrasher(at)fibers(dot)upc(dot)es>
To: "Berman, Phil" <PBerman(at)northropgrumman(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Backend message type 0x50 arrived while idle
Date: 2002-12-05 09:27:48
Message-ID: 3DEF1C14.2000008@fibers.upc.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org)
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2002-12-05 09:44:42 Re: Query about table and catalog
Previous Message kanika singh 2002-12-05 09:11:10 Regarding boolean datatype