Some sql query got stuck in poll. - Mailing list pgsql-odbc

From Pavan
Subject Some sql query got stuck in poll.
Date
Msg-id 1411641754892-5820447.post@n5.nabble.com
Whole thread Raw
Responses Re: Some sql query got stuck in poll.  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-odbc
Hi,

I have application running in multi-threaded architecture and application
updates DB from data in cache periodically . But unfortunately we are
getting some query got stuck in poll for indefinite time. This behavior is
happened some time with application but not any particular scenario. We can
not reproduce it always it's random issue. We have design to restart
application if it got stuck for more than specified time period.

I have attached some back trace for query processing as below:

=======================================================================================

#0 0x00007ff6d6f11ff3 in poll () from /lib64/libc.so.6
#1 0x00007ff6d0f9e467 in SOCK_wait_for_ready (sock=0x162ba20, output=0,
retry_count=1) at socket.c:512
#2 0x00007ff6d0f9f5e1 in SOCK_get_next_byte (self=0x162ba20, peek=0) at
socket.c:930
#3 0x00007ff6d0f9f6f3 in SOCK_get_id (self=0x162ba20) at socket.c:685
#4 0x00007ff6d0f79e59 in CC_send_query_append (self=0x1628230,
query=0x1635c30 "UPDATE call_stats SET Peeringid=1, Setup=0, Connect=0,
DroppedSetup=0, OutSetup=0, InInvite=0, InReInvite=0, In1xx=0, In2xx=0,
InRe2xx=0, In3xx=0, In4xx=0, In5xx=0, In6xx=0, InAck=0, InReAck=0,
InCanc"..., qi=0x0, flag=4, stmt=0x1632b40, appendq=<optimized out>) at
connection.c:2805
#5 0x00007ff6d0faa44e in SC_execute (self=0x1632b40) at statement.c:2003
#6 0x00007ff6d0f8951e in Exec_with_parameters_resolved (stmt=0x1632b40,
exec_end=0x7fff9f4488b8) at execute.c:511
#7 0x00007ff6d0f8a8ca in PGAPI_Execute (hstmt=0x1632b40, flag=<optimized
out>) at execute.c:1153
#8 0x00007ff6d0fb0a8c in SQLExecute (StatementHandle=0x1632b40) at
odbcapi.c:376
#9 0x00007ff6d819fb16 in SQLExecute (statement_handle=0x160bd30) at
SQLExecute.c:287
#10 0x0000000000467ae6 in ODBCDbModify (dmltype=DB_UPDATE, sql=0xcee5f8,
tablename=0x5f8663 "call_stats", incols=0x7fff9f448b80, incolcount=32,
conditions=0x7fff9f448e80,
conditioncount=3, affectedrowcount=0x7fff9f448ec8, publish_evt=0) at
/usr/src/packages/iserver/server/x86_64/../db_mysql.c:1175
#11 0x0000000000468cb5 in ODBCDbUpdate (sql=<optimized out>,
tablename=<optimized out>, incols=<optimized out>, incolcount=<optimized
out>, conditions=<optimized out>,
conditioncount=<optimized out>, affectedrowcount=0x7fff9f448ec8,
publish_evt=0) at /usr/src/packages/iserver/server/x86_64/../db_mysql.c:908
#12 0x0000000000488547 in DSStoreEntry (publish_evt=0,
affectedrowcount=0x7fff9f448ec8, conditioncount=3, incolcount=32,
cols=0x7fff9f448b80, tablename=0x5f8663 "call_stats",
storesql=0xcee5f8) at
/usr/src/packages/iserver/server/x86_64/../dbservice.c:2347
#13 DbStoreCallStatsEntry (db=<optimized out>, entry=<optimized out>,
skey=<optimized out>, skeylen=<optimized out>)
at /usr/src/packages/iserver/server/x86_64/../dbservice.c:15977
#14 0x0000000000457a7c in insertIntervalStats (intervalStat=0x15f4fe8,
instanceId=1, type=SEC, isUpdate=false) at ../sync_db.c:234
#15 0x00000000004559f9 in populateIntervalStats (destStat=<optimized out>,
origStat=<optimized out>, iter=60, type=SEC) at ../sync_utility.c:40
#16 0x0000000000453320 in callStatsHeapPopulate () at ../initializer.c:419
#17 0x000000000045502b in initInMemoryDS () at ../initializer.c:146
#18 0x000000000044f662 in main (argc=<optimized out>, argv=0x7fff9f4491c8)
at ../main.c:136

=====================================================================================

#0 0x00007f97d955eff3 in poll () from /lib64/libc.so.6
#1 0x00007f97d76ebec9 in SOCK_connect_to (self=0x1545970, port=<optimized
out>, hostname=<optimized out>, timeout=10) at socket.c:395
#2 0x00007f97d76c8df9 in original_CC_connect (self=0x157e580,
password_req=<optimized out>, salt_para=<optimized out>) at
connection.c:1541
#3 0x00007f97d76ca241 in CC_connect (self=0x157e580, password_req=0 '\000',
salt_para=0x7fff177ebec0 "") at connection.c:2022
#4 0x00007f97d76d49cc in PGAPI_DriverConnect (hdbc=0x157e580,
hwnd=<optimized out>, szConnStrIn=<optimized out>, cbConnStrIn=<optimized
out>, szConnStrOut=0x7fff177f0340 "",
cbConnStrOutMax=4096, pcbConnStrOut=0x7fff177f146e, fDriverCompletion=0) at
drvconn.c:225
#5 0x00007f97d76fd6a0 in SQLDriverConnect (hdbc=0x157e580, hwnd=0x0,
szConnStrIn=0x8603ac "SERVERNAME=10.10.10.21;DSN=msw;DATABASE=msw;UID=msw",
cbConnStrIn=51,
szConnStrOut=<optimized out>, cbConnStrOutMax=4096,
pcbConnStrOut=0x7fff177f146e, fDriverCompletion=0) at odbcapi.c:226
#6 0x00007f97daa0e755 in SQLDriverConnect (hdbc=0x157a5c0, hwnd=0x0,
conn_str_in=0x8603ac "SERVERNAME=10.10.10.21;DSN=msw;DATABASE=msw;UID=msw",
len_conn_str_in=51,
conn_str_out=0x7fff177f0340 "", conn_str_out_max=4096,
ptr_conn_str_out=0x7fff177f146e, driver_completion=0) at
SQLDriverConnect.c:1250
#7 0x0000000000459e1b in DetectMasterDbConnection (useslaveifnomaster=0) at
/d4/rel8.1/patches/8.1.2/8.1.2.7/SBC/server/x86_64/../db_mysql.c:2273
#8 0x0000000000457f09 in DbGetConnection (hdbc=0x7fff177f2580) at
/d4/rel8.1/patches/8.1.2/8.1.2.7/SBC/server/x86_64/../db_mysql.c:2105
#9 0x000000000045b02d in ODBCDbModify (dmltype=DB_INSERT, sql=0xc81b40,
tablename=0x5aa06c "call_stats", incols=0x7fff177f2650,
incolcount=<optimized out>, conditions=0x0,
conditioncount=0, affectedrowcount=0x7fff177f2998, publish_evt=0) at
/d4/rel8.1/patches/8.1.2/8.1.2.7/SBC/server/x86_64/../db_mysql.c:1093
#10 0x000000000045c002 in ODBCDbInsert (sql=<optimized out>,
tablename=<optimized out>, incols=<optimized out>, incolcount=<optimized
out>, affectedrowcount=<optimized out>,
publish_evt=<optimized out>) at
/d4/rel8.1/patches/8.1.2/8.1.2.7/SBC/server/x86_64/../db_mysql.c:888
#11 0x0000000000478b44 in DSInsertEntry (publish_evt=0,
affectedrowcount=0x7fff177f2998, incolcount=35, cols=0x7fff177f2650,
tablename=0x5aa06c "call_stats", insertsql=0xc81b40)
at /d4/rel8.1/patches/8.1.2/8.1.2.7/SBC/server/x86_64/../dbservice.c:2080
#12 DbInsertCallStatsEntry (db=<optimized out>, entry=<optimized out>,
skey=<optimized out>, skeylen=<optimized out>)
at /d4/rel8.1/patches/8.1.2/8.1.2.7/SBC/server/x86_64/../dbservice.c:14982
#13 0x000000000044ce11 in insertIntervalStats (intervalStat=0x152e518,
instanceId=7, type=SEC, isUpdate=false) at ../sync_db.c:217
#14 0x000000000044b029 in populateIntervalStats (destStat=<optimized out>,
origStat=<optimized out>, iter=60, type=SEC) at ../sync_utility.c:40
#15 0x0000000000448d90 in callStatsHeapPopulate () at ../initializer.c:411
#16 0x000000000044a76b in initInMemoryDS () at ../initializer.c:140
#17 0x0000000000445611 in main (argc=<optimized out>, argv=0x7fff177f2c88)
at ../main.c:158

======================================================================================

#0 0x00007fb2f0a23ff3 in poll () from /lib64/libc.so.6
#1 0x00007fb2eaab0467 in SOCK_wait_for_ready (sock=0x1645130, output=0,
retry_count=1) at socket.c:512
#2 0x00007fb2eaab15e1 in SOCK_get_next_byte (self=0x1645130, peek=0) at
socket.c:930
#3 0x00007fb2eaab16f3 in SOCK_get_id (self=0x1645130) at socket.c:685
#4 0x00007fb2eaa8be59 in CC_send_query_append (self=0x1641940,
query=0x7fb2eaad4d2d "COMMIT", qi=0x0, flag=0, stmt=0x0, appendq=<optimized
out>) at connection.c:2805
#5 0x00007fb2eaa8d99b in CC_commit (self=0x1641940) at connection.c:512
#6 0x00007fb2eaa9cf95 in PGAPI_Transact (henv=0x0, hdbc=0x1641940, fType=0)
at execute.c:1221
#7 0x00007fb2eaac6dc5 in SQLEndTran (HandleType=<optimized out>,
Handle=0x1641940, CompletionType=0) at odbcapi30.c:176
#8 0x00007fb2f1cb0623 in SQLEndTran (handle_type=<optimized out>,
handle=0x164add0, completion_type=0) at SQLEndTran.c:486
#9 0x000000000046aef6 in ODBCDbModify (dmltype=DB_UPDATE, sql=0xd01f38,
tablename=0x607400 "call_stats", incols=0x7fff1862db80, incolcount=32,
conditions=0x7fff1862de80, conditioncount=3,
affectedrowcount=0x7fff1862dec8, publish_evt=0) at
/usr/src/packages/iserver/server/x86_64/../db_mysql.c:1290
#10 0x000000000046b6b5 in ODBCDbUpdate (sql=<optimized out>,
tablename=<optimized out>, incols=<optimized out>, incolcount=<optimized
out>,
conditions=<optimized out>, conditioncount=<optimized out>,
affectedrowcount=0x7fff1862dec8, publish_evt=0)
at /usr/src/packages/iserver/server/x86_64/../db_mysql.c:909
#11 0x000000000048c857 in DSStoreEntry (publish_evt=0,
affectedrowcount=0x7fff1862dec8, conditioncount=3, incolcount=32,
cols=0x7fff1862db80,
tablename=0x607400 "call_stats", storesql=0xd01f38) at
/usr/src/packages/iserver/server/x86_64/../dbservice.c:2380
#12 DbStoreCallStatsEntry (db=<optimized out>, entry=<optimized out>,
skey=<optimized out>, skeylen=<optimized out>)
at /usr/src/packages/iserver/server/x86_64/../dbservice.c:16603
#13 0x000000000045a36c in insertIntervalStats (intervalStat=0x16129f0,
instanceId=42, type=MIN, isUpdate=false) at ../sync_db.c:229
#14 0x00000000004582f9 in populateIntervalStats (destStat=<optimized out>,
origStat=<optimized out>, iter=60, type=MIN) at ../sync_utility.c:40
#15 0x0000000000455c42 in callStatsHeapPopulate () at ../initializer.c:422
#16 0x000000000045792b in initInMemoryDS () at ../initializer.c:146
#17 0x0000000000451dd2 in main (argc=<optimized out>, argv=0x7fff1862e1c8)
at ../main.c:142

=====================================================================================

Please help me to identify root cause of this problem as this is coming with
different release of PostgresSQL-ODBC driver.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/Some-sql-query-got-stuck-in-poll-tp5820447.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


pgsql-odbc by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [PATCH] Return the correct column names in SQLTables
Next
From: Heikki Linnakangas
Date:
Subject: Re: Some sql query got stuck in poll.