本帖最后由 TimiZheng 于 2019-10-18 16:58 编辑
以下问题为去年的问题,记录在自己的为知笔记中,拿出来分享下。现象:运行了两年的mycat,突然变得十分不稳定。 4个mycat实例,在运行一段时间(有时几个小时,有时1-2天)总会出现偶尔无法连接等问题,监控程序经常会报错。
日志:查看mycat.log日志中,没有任何的信息。 在console.log中找到stackoverflowerror,但是只有1条这样的错误,和检测不能连接的时间并不相同。所以当时没有在意。 对jvm进行分析,也没有发现问题,没有长时间的gc。 找java开发的大牛,对jvm参数一通调整,各种分析,还是无济于事。 经过一个星期的折腾,慢慢发现了规律。 规律:重启后一段时间内会很正常,但是一旦出现stackoverflowerror错误,后面就会陆续出现不能连接的情况,随着时间推移,不能连接会越来越严重,直到守护进程认为mycat不可用,就会自动重启程序。 于是开始仔细检查这个错误:
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei="">Exception in thread "$_NIOREACTOR-3-RW"
- 2018-03-27T02:16:14.612+0800: 196587.704: Total time for which application
- threads were stopped: 0.0019378 seconds, Stopping threads took: 0.0001489
- seconds</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei="">java.lang.StackOverflowError</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.visitor.functions.Concat.eval_r(Concat.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.visit(SQLEvalVisitorUtils.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.visitor.SQLEvalVisitorImpl.visit(SQLEvalVisitorImpl.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.ast.expr.SQLMethodInvokeExpr.accept0(SQLMethodInvokeExpr.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.visit(SQLEvalVisitorUtils.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.visitor.SQLEvalVisitorImpl.visit(SQLEvalVisitorImpl.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr.accept0(SQLBinaryOpExpr.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.wall.spi.WallVisitorUtils.eval_r(WallVisitorUtils.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.wall.spi.WallVisitorUtils.getValue(WallVisitorUtils.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.wall.spi.WallVisitorUtils.getValue(WallVisitorUtils.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- com.alibaba.druid.wall.spi.WallVisitorUtils.getValue(WallVisitorUtils.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.route.util.RouterUtil.isConditionAlwaysFalse(RouterUtil.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.addExprIfNotFalse(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei=""> <wbr> <wbr> <wbr> <wbr> at
- org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor.</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei="">...........................</p>
- <p style="margin: 8px 0px; font-family: Helvetica,;" hiragino="" sans="" yahei="">org.opencloudb.parser.druid.MycatSchemaStatVisitor.splitUntilNoOr(MycatSchemaStatVisitor. </p>
复制代码
|