Search Postgresql Archives

Re: PQConsumeinput stuck on recv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I was able to capture the backtrace again, now with libpq debugging symbols.

Thread 15 (Thread 0x7f8cec068700 (LWP 68)):
#0  0x00007f8d252a1d9b in __libc_recv (fd=150, buf=0x7f8cf0034410,
n=16384, flags=623517083, flags@entry=0) at
../sysdeps/unix/sysv/linux/x86_64/recv.c:33
#1  0x00007f8d26689783 in recv (__flags=0, __n=<optimized out>,
__buf=<optimized out>, __fd=<optimized out>) at
/usr/include/x86_64-linux-gnu/bits/socket2.h:44
#2  pqsecure_raw_read (conn=conn@entry=0x7f8cf001e390, ptr=<optimized
out>, len=<optimized out>) at
/build/postgresql-10-rIfDLC/postgresql-10-10.2/build/../src/interfaces/libpq/fe-secure.c:230
#3  0x00007f8d26689863 in pqsecure_read
(conn=conn@entry=0x7f8cf001e390, ptr=<optimized out>, len=<optimized
out>) at /build/postgresql-10-rIfDLC/postgresql-10-10.2/build/../src/interfaces/libpq/fe-secure.c:217
#4  0x00007f8d266810ea in pqReadData (conn=conn@entry=0x7f8cf001e390)
at /build/postgresql-10-rIfDLC/postgresql-10-10.2/build/../src/interfaces/libpq/fe-misc.c:683
#5  0x00007f8d2667e6f2 in PQconsumeInput (conn=0x7f8cf001e390) at
/build/postgresql-10-rIfDLC/postgresql-10-10.2/build/../src/interfaces/libpq/fe-exec.c:1704

In this case, I also checked the pg_stat_activity and this particular
connection on pg server side was idle for 15 minutes. I killed it
using pg_terminate_backend, and then somehow the application resumed
execution.

As you can see, recv has received a non-zero value in flags, which has
the MSG_WAITALL bit is set, however in this case the application
expects the read to be non-blocking.

Thanks in advance,

André Freitas

2018-02-23 16:10 GMT-03:00 Andres Freund <andres@xxxxxxxxxxx>:
> Hi,
>
> On 2018-02-23 15:59:18 -0300, Andre Oliveira Freitas wrote:
>> I'm using the libpq that comes with debian, however I can install the
>> library from the official repository to be sure, I assume the one from
>> the official repo has it enabled.
>
> That should be fine. Could you get the backtrace again, after installing
> debugging symbols? It'd certainly be helpful to see the exact path to
> the blocking syscall.
>
> Greetings,
>
> Andres Freund



-- 

André Luis O. Freitas
System Architect

Rua do Rócio, 220 - Cj. 72
São Paulo - SP - 04552-000
55 11 4063 4222

afreitas@xxxxxxxxxxxxx
www.callix.com.br





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux