Oracle instant client with odpi-c creating core dumps when timeouts are configured in sqlnet.ora

131 Views Asked by At

We have a real-time application deployment where our C application is built with ODPI-C. We are using,

  • Oracle DB 11.2
  • Oracle Instant Client (19.11-basic-19.11.0.0.0-1) which is compatible with 11.2
  • ODPI-C version 4.1.0

We have a scenario where we are writing logs in a partitioned table in DB. We are using fixed connection pool in our application. We have set a pool-session-get-timeout in ODPI-C for scenarios when we don't get sessions from pool. We really want to do the DB op fast. If we can not do that we have default reply which is okay sometimes. We also face space issue for longer periods of time and then, we can no longer write to the table. At that time, we noticed that query execution was taking more than 2s and it was not the behavior we wanted. So I added a recv_timeout and connect_timeout in sqlnet.ora to keep query execution on a leash. But in production We are seeing core dumps being generated after adding the timeouts. It is pointing to a function deep inside libclntsh from instant client. Following is a core dump backtrace and sqlnet.ora contents.

backtrace:(some of the stack is omitted)

#0  0x00007f5a949d2d00 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1  0x00007f5a910a3323 in kpucopyuserhndl () from /usr/lib/oracle/19.11/client64/lib/libclntsh.so
#2  0x00007f5a91142142 in kpuspextend () from /usr/lib/oracle/19.11/client64/lib/libclntsh.so
#3  0x00007f5a911445ac in kpuspgetfreesession () from /usr/lib/oracle/19.11/client64/lib/libclntsh.so
#4  0x00007f5a91140f6f in kpuspgetpooledsession () from /usr/lib/oracle/19.11/client64/lib/libclntsh.so
#5  0x00007f5a9113d04d in kpuspsessionget () from /usr/lib/oracle/19.11/client64/lib/libclntsh.so
#6  0x00007f5a90e7dd01 in OCISessionGet () from /usr/lib/oracle/19.11/client64/lib/libclntsh.so
#7  0x00007f5a947aaba4 in dpiOci__sessionGet (envHandle=0xa99320, handle=handle@entry=0x7f5a4c011c60, authInfo=authInfo@entry=0x7f59d4027f40,
    connectString=connectString@entry=0xace088 "OCI:SP:zioqnnkyJjHgU6hJZQoktC", connectStringLength=connectStringLength@entry=29, tag=<optimized out>,
    tagLength=0, outTag=outTag@entry=0x7f5a808458c8, outTagLength=outTagLength@entry=0x7f5a808458d0, found=found@entry=0x7f5a808458d4, mode=mode@entry=1,
    error=error@entry=0x7f5a80845850) at src/dpiOci.c:3120
#8  0x00007f5a94790224 in dpiConn__getSession (error=0x7f5a80845850, authInfo=0x7f59d4027f40, params=0x7f5a80845870, connectStringLength=29,
    connectString=0xace088 "OCI:SP:zioqnnkyJjHgU6hJZQoktC", mode=1, conn=0x7f5a4c011c40) at src/dpiConn.c:769
#9  dpiConn__get (error=0x7f5a80845850, pool=0xa99180, createParams=0x7f5a80845870, connectStringLength=29,
    connectString=0xace088 "OCI:SP:zioqnnkyJjHgU6hJZQoktC", passwordLength=<optimized out>, password=<optimized out>, userNameLength=<optimized out>,
    userName=<optimized out>, conn=0x7f5a4c011c40) at src/dpiConn.c:579
#10 dpiConn__create (conn=0x7f5a4c011c40, context=<optimized out>, userName=userName@entry=0x0, userNameLength=userNameLength@entry=0,
    password=password@entry=0x0, passwordLength=passwordLength@entry=0, connectString=0xace088 "OCI:SP:zioqnnkyJjHgU6hJZQoktC", connectStringLength=29,
    pool=pool@entry=0xa99180, commonParams=commonParams@entry=0x0, createParams=createParams@entry=0x7f5a80845870, error=error@entry=0x7f5a80845850)
    at src/dpiConn.c:378
#11 0x00007f5a94799aa1 in dpiPool__acquireConnection (pool=pool@entry=0xa99180, userName=userName@entry=0x0, userNameLength=userNameLength@entry=0,
    password=password@entry=0x0, passwordLength=0, params=params@entry=0x7f5a80845870, conn=conn@entry=0x7f5a80845958, error=error@entry=0x7f5a80845850)
    at src/dpiPool.c:36

sqlnet.ora file contents:

SQLNET.RECV_TIMEOUT=200ms
SQLNET.OUTBOUND_CONNECT_TIMEOUT=300ms
DIAG_ADR_ENABLED=OFF
DIAG_SIGHANDLER_ENABLED=FALSE
DIAG_DDE_ENABLED=FALSE

We are seeing a new instant client version released 19.12 and we used the previous version. But I am not quite sure this new version would fix this issue as this is a minor version update not a patch or bug fix. But to be very honest I am feeling quite lost as I am seeing a core dump in oracle library that I can not do anything about. Not many questions are found on the internet too. Any guidance?

0

There are 0 best solutions below