线程在 JDBC Teradata 请求上永久挂起
我正在使用 JDBC 查询 Teradata 服务器。最多有 100 个并发请求,每个请求都使用一个新连接,并在最后关闭它。经过几个小时的工作后,某些执行请求的线程会无限期地卡住。最终需要重新启动系统。 通过检查调用堆栈,我发现线程处于套接字读取状态,并且在准备语句或关闭连接时发生:
情况 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.<init>(PreparedStatement.java:66)
at com.teradata.jdbc.jdbc_4.TDSession.createPreparedStatement(TDSession.java:723)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalPreparedStatement.<init>(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)
...
情况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)
...
我使用的是 JDBC Teradata 驱动程序版本 13.10.00.10。
知道为什么会发生吗? 这个问题对我们来说非常痛苦,任何帮助将不胜感激。
谢谢!
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 system 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.<init>(PreparedStatement.java:66)
at com.teradata.jdbc.jdbc_4.TDSession.createPreparedStatement(TDSession.java:723)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalPreparedStatement.<init>(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 JDBC Teradata 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过升级到 JDBC 驱动程序的最新补丁版本? 13.10.00.18 于 2011 年 4 月 12 日发布。版本 13.10.00.15 包含一个补丁,用于纠正多线程并发登录尝试抛出 GSSException:MIC 计算期间错误的问题。
如果这不能解决问题,并且您的客户/公司是 Teradata 客户,我建议您向 Teradata 全球支持中心提出事件。
Have you tried upgrading to the latest patch release of the JDBC driver? 13.10.00.18 was released 2011-04-12. Release 13.10.00.15 included a patch to correct a problem with multi-threaded concurrent logon attempts throwing a GSSException: Error during MIC calculation.
If this doesn't remedy the problem and your client/company is a Teradata customer I would suggest that opening an incident with the Teradata Global Support Center.