From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kiran Khatke <kirankhatke23may@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16007: Regarding patch for BUG #3995: pqSocketCheck doesn't return
Date: Mon, 16 Sep 2019 09:54:55 -0400
Message-ID: <31394.1568642095@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGKgC8UNrx3nzgfyKUt9mXdM3sKakxZJV-cd4MLh5+C+UgkDgw@mail.gmail.com>
References: <16007-1d32de61f44fe1f4@postgresql.org>
<27311.1568319454@sss.pgh.pa.us>
<CAGKgC8UNrx3nzgfyKUt9mXdM3sKakxZJV-cd4MLh5+C+UgkDgw@mail.gmail.com>
Kiran Khatke <kirankhatke23may@gmail.com> writes:
> One of the thread of DBMGR Daemon is waiting for the result of poll()
> function.
> poll() was called by pgSocketCheck(). So pqSocketCheck() didn't return,
> hung in poll().
> Below is the backtrace.
Well, it's waiting for the query to finish, or so it thinks. Did you
look at what the server thinks the session is doing?
Your reference to multiple threads is a red flag to me. Very often
we see people whose programs try to use the same PGconn object from
multiple threads. That doesn't work --- and libpq does not have any
internal mutexes that would prevent the object's state from getting
messed up by concurrent operations. So a plausible theory is that
this PGconn was used concurrently, and now this particular thread
is stuck because the object's state is corrupt (ie, it shows the
query as busy but the server doesn't think so).
It might be worth enabling log_statement = all on the server side
and then watching the server log to see what seems to be happening
from that end.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, kirankhatke23may@gmail.com
Subject: Re: BUG #16007: Regarding patch for BUG #3995: pqSocketCheck doesn't return
In-Reply-To: <31394.1568642095@sss.pgh.pa.us>
References: <16007-1d32de61f44fe1f4@postgresql.org> <27311.1568319454@sss.pgh.pa.us> <CAGKgC8UNrx3nzgfyKUt9mXdM3sKakxZJV-cd4MLh5+C+UgkDgw@mail.gmail.com> <31394.1568642095@sss.pgh.pa.us>
* 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