Describe the bug
com.dianping.cat.message.spi.codec.NativeMessageCodec 的
encodeMessage 可能发生 ConcurrentModificationException 异常
private void encodeMessage(Context ctx, ByteBuf buf, Message msg) {
if (msg instanceof Transaction) {
Transaction transaction = (Transaction) msg;
List<Message> children = transaction.getChildren();
for (Message child : children) {
if (child != null) {
encodeMessage(ctx, buf, child);
}
}
}
...
}
children 数组大小可能发生变化,当children数组发生变化时会报出 ConcurrentModificationException 异常
Smartphone (please complete the following information):
- Version 3.0.0
2条答案
按热度按时间hgc7kmma1#
你好,目前看3.1.0版本的写法已经进行了调整,可以考虑升级
uklbhaso2#
解决方案