mariadb 通信例外:连接失败时,应用程序正在对结果进行流式处理,请考虑提高服务器上的“net_write_timeout”值

x6h2sr28  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(119)

我正在使用Slick(3.3.2)流媒体与Mariadb 5.5。它开始打破后,几分钟与此错误:

Connection com.mysql.jdbc.JDBC4Connection@105f8738 marked as broken because of SQLSTATE(08S01), ErrorCode(0)"
181773:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Application was streaming results when the connection failed. Consider raising value of 'net_write_timeout' on the server.
181774- at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_312]
181775- at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_312]
181776- at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_312]
181777- at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_312]
181778- at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181779: at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181780- at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3559) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181781- at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3459) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181782- at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3900) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181783- at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181784- at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1996) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181785- at com.mysql.jdbc.RowDataDynamic.nextRecord(RowDataDynamic.java:374) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181786- at com.mysql.jdbc.RowDataDynamic.next(RowDataDynamic.java:354) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181787- at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6327) ~[mysql.mysql-connector-java-5.1.41.jar:5.1.41]
181788- at com.zaxxer.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java) ~[com.zaxxer.HikariCP-3.2.0.jar:?]
181789- at slick.jdbc.PositionedResult.nextRow(PositionedResult.scala:26) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181790- at slick.jdbc.PositionedResultIterator.fetchNext(PositionedResult.scala:175) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181791- at slick.util.ReadAheadIterator.update(ReadAheadIterator.scala:28) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181792- at slick.util.ReadAheadIterator.hasNext(ReadAheadIterator.scala:34) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181793- at slick.util.ReadAheadIterator.hasNext$(ReadAheadIterator.scala:33) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181794- at slick.jdbc.PositionedResultIterator.hasNext(PositionedResult.scala:167) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181795- at slick.jdbc.StreamingInvokerAction.emitStream(StreamingInvokerAction.scala:31) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]
181796- at slick.jdbc.StreamingInvokerAction.emitStream$(StreamingInvokerAction.scala:26) ~[com.typesafe.slick.slick_2.12-3.3.2.jar:?]

我尝试更改net_write_timeout的值(从90秒更改为180秒),但没有任何帮助。如有任何帮助,将不胜感激。

dgsult0t

dgsult0t1#

如果启用流式结果,则可能应在连接字符串中添加"netTimeoutForStreamingResults=28800"等。它将覆盖服务器端的"net_write_timeout"值,mysql/connect/j/5.1.47处的"netTimeoutForStreamingResults"默认为600s

相关问题