Weblogic 在 JDBC 调用上卡住了线程

发布于 2024-10-09 09:23:31 字数 2393 浏览 2 评论 0原文

我们经常在 Weblogic 服务器上遇到一系列卡住的线程。我已经分析过这个问题一段时间了。

我想了解的是,这个卡住的线程块是否表明它仍在从打开的套接字读取数据到数据库,因为查询是简单的 SELECT 内容?

at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at oracle.net.ns.Packet.receive(Packet.java:239)
        at oracle.net.ns.DataPacket.receive(DataPacket.java:92)

我们运行了 netstat 和其他命令,从 Weblogic 应用服务器到数据库的套接字与池中的连接数相匹配。

有什么想法我们还应该在这里调查什么吗?

线程转储的堆栈跟踪:

"[STUCK] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x61a5b000 nid=0x25f runnable [0x6147b000..0x6147eeb0]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at oracle.net.ns.Packet.receive(Packet.java:239)
        at oracle.net.ns.DataPacket.receive(DataPacket.java:92)
        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1023)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:999)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:584)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
        at oracle.jdbc.driver.T4CStatement.fetch(T4CStatement.java:1000)
        at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:314)
        - locked <0x774546e0> (a oracle.jdbc.driver.T4CConnection)
        at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:228)
        - locked <0x774546e0> (a oracle.jdbc.driver.T4CConnection)
        at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.next(Unknown Source)

weblogic.work.ExecuteThread.run开始到此处的位已被省略。我们有 8 组线程转储 - 每组都显示线程在同一行等待,并且同一对象被锁定

at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:314)
        - locked <0x774546e0> (a oracle.jdbc.driver.T4CConnection)

We frequently get a series of Stuck threads on our Weblogic servers. I've analyzed this over a period of time.

What I'd like to understand is whether this stuck thread block indicates it is still reading data from the open socket to the database since the queries are simple SELECT stuff?

at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at oracle.net.ns.Packet.receive(Packet.java:239)
        at oracle.net.ns.DataPacket.receive(DataPacket.java:92)

We've run netstat and other commands, the sockets from the Weblogic app server to the Database match the number of connections in the pool.

Any ideas what else we should be investigating here?

Stack trace of thread dump:

"[STUCK] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x61a5b000 nid=0x25f runnable [0x6147b000..0x6147eeb0]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at oracle.net.ns.Packet.receive(Packet.java:239)
        at oracle.net.ns.DataPacket.receive(DataPacket.java:92)
        at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
        at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1023)
        at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:999)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:584)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
        at oracle.jdbc.driver.T4CStatement.fetch(T4CStatement.java:1000)
        at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:314)
        - locked <0x774546e0> (a oracle.jdbc.driver.T4CConnection)
        at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:228)
        - locked <0x774546e0> (a oracle.jdbc.driver.T4CConnection)
        at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.next(Unknown Source)

The bit starting from weblogic.work.ExecuteThread.run to here has been omitted. We have 8 sets of thread dumps - and each show the thread waiting on the same line, and the same object locked

at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:314)
        - locked <0x774546e0> (a oracle.jdbc.driver.T4CConnection)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

玩心态 2024-10-16 09:23:31

如果您使用 weblogic 调试标志 -Dweblogic.debug.DebugJDBCSQL 您将能够跟踪实际正在执行的 SQL

if you use weblogic debug flag -Dweblogic.debug.DebugJDBCSQL you will be able to trace the SQL which is actually being executed

蓝咒 2024-10-16 09:23:31

在打印堆栈时,它似乎被阻止等待来自服务器的更多数据,

at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:228)

也许这只是查询花费的时间超过了 StuckThreadMaxTime 并且 WL 发出了警告。

如果可能的话,我会尝试:

  • 查找哪个或哪些查询导致线程卡住并检查执行时间
  • 使用 Wireshark 分析与数据库的通信
  • 查看驱动程序源代码(我想到了 JD)以了解堆栈跟踪

At the time the stack was printed, it seems blocked waiting for more data from the server

at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:228)

Maybe it is just the query which is taking more than StuckThreadMaxTimeand WL issues a Warning.

If possible I would try:

  • Find which query or queries are getting the threads stuck and check execution time
  • Use Wireshark to analyze communication with database
  • Have a look at the driver source code (JD comes to mind) to understand stack trace
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文