Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XXXzr-0006aP-DC for pgsql-odbc@arkaria.postgresql.org; Fri, 26 Sep 2014 16:03:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XXXzq-0007z8-Ta for pgsql-odbc@arkaria.postgresql.org; Fri, 26 Sep 2014 16:03:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XX6VW-0007wT-Af for pgsql-odbc@postgresql.org; Thu, 25 Sep 2014 10:42:42 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XX6VR-0004ix-Bv for pgsql-odbc@postgresql.org; Thu, 25 Sep 2014 10:42:40 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XX6VO-0007Xv-UA for pgsql-odbc@postgresql.org; Thu, 25 Sep 2014 03:42:34 -0700 Date: Thu, 25 Sep 2014 03:42:34 -0700 (PDT) From: Pavan To: pgsql-odbc@postgresql.org Message-ID: <1411641754892-5820447.post@n5.nabble.com> Subject: Some sql query got stuck in poll. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org 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=) 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=) 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=, tablename=, incols=, incolcount=, conditions=, conditioncount=, 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=, entry=, skey=, skeylen=) 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=, origStat=, 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=, argv=0x7fff9f4491c8) at ../main.c:136 ===================================================================================== #0 0x00007f97d955eff3 in poll () from /lib64/libc.so.6 #1 0x00007f97d76ebec9 in SOCK_connect_to (self=0x1545970, port=, hostname=, timeout=10) at socket.c:395 #2 0x00007f97d76c8df9 in original_CC_connect (self=0x157e580, password_req=, salt_para=) 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=, szConnStrIn=, cbConnStrIn=, 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=, 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=, 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=, tablename=, incols=, incolcount=, affectedrowcount=, publish_evt=) 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=, entry=, skey=, skeylen=) 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=, origStat=, 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=, 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=) 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=, Handle=0x1641940, CompletionType=0) at odbcapi30.c:176 #8 0x00007fb2f1cb0623 in SQLEndTran (handle_type=, 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=, tablename=, incols=, incolcount=, conditions=, conditioncount=, 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=, entry=, skey=, skeylen=) 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=, origStat=, 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=, 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. -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc