Threads hanging permanently on Teradata requests

Connectivity

Threads hanging permanently on Teradata requests

Hi,

I'm using JDBC to query a Teradata server. There are up to 100 simultaneous requests, each one using a fresh connection, and closing it at the end. After some hours of work, some of the threads performing the requests get stuck indefinitely. Eventually a restart is needed.
From inspecting the call stacks, I see that the threads are in a socket read state, and that it happens when preparing a statement or when closing the connection:

Case 1:
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:649)
at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:818)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:125)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:112)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:103)
at com.teradata.jdbc.jdbc_4.Statement.executeStatement(Statement.java:340)
at com.teradata.jdbc.jdbc_4.Statement.prepareRequest(Statement.java:507)
- locked <0x00002aab4f787518> (a com.teradata.jdbc.jdbc_4.PreparedStatement)
at com.teradata.jdbc.jdbc_4.PreparedStatement.(PreparedStatement.java:66)
at com.teradata.jdbc.jdbc_4.TDSession.createPreparedStatement(TDSession.java:723)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalPreparedStatement.(TeraLocalPreparedStatement.java:89)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.prepareStatement(TeraLocalConnection.java:333)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.prepareStatement(TeraLocalConnection.java:152)
...

Case 2:
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:649)
at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:818)
at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:794)
at com.teradata.jdbc.jdbc.GenericLogOffRspState.action(GenericLogOffRspState.java:66)
at com.teradata.jdbc.jdbc.GenericLogoffController.run(GenericLogoffController.java:43)
- locked <..> (a com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF)
at com.teradata.jdbc.jdbc_4.TDSession.close(TDSession.java:476)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.close(TeraLocalConnection.java:259)
...

I'm using the latest driver version (13.10.00.10)

Any idea why it happens?
This issue is very painful for us and any help will be appreciated.

Thanks!
Tags (1)
1 REPLY
Teradata Employee

Re: Threads hanging permanently on Teradata requests

In the stack traces you listed, the Teradata JDBC Driver is waiting for a response from the Teradata Database.

If the problem is reproducible, then I recommend that you open an incident with Customer Support.