开发者社区> 问答> 正文

canal-adapter报错java.io.IOException: Broken pipe,se

在使用cananl-adapter和canalserver的时候,canal-adapter报错: 2021-03-31 19:16:34.568 [Thread-4] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - process error! com.alibaba.otter.canal.protocol.exception.CanalClientException: java.io.IOException: Broken pipe at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.subscribe(SimpleCanalConnector.java:254) ~[na:na] at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.subscribe(SimpleCanalConnector.java:226) ~[na:na] at com.alibaba.otter.canal.connector.tcp.consumer.CanalTCPConsumer.connect(CanalTCPConsumer.java:60) ~[na:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.process(AdapterProcessor.java:184) ~[client-adapter.launcher-1.1.5-SNAPSHOT.jar:na] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_262] Caused by: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[na:1.8.0_262] at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[na:1.8.0_262] at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_262] at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_262] at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:468) ~[na:1.8.0_262] at java.nio.channels.Channels.writeFullyImpl(Channels.java:78) ~[na:1.8.0_262] at java.nio.channels.Channels.writeFully(Channels.java:98) ~[na:1.8.0_262] at java.nio.channels.Channels.access$000(Channels.java:61) ~[na:1.8.0_262] at java.nio.channels.Channels$1.write(Channels.java:174) ~[na:1.8.0_262] at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:458) ~[na:1.8.0_262] at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.writeWithHeader(SimpleCanalConnector.java:393) ~[na:na] at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.writeWithHeader(SimpleCanalConnector.java:381) ~[na:na] at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.subscribe(SimpleCanalConnector.java:235) ~[na:na] ... 4 common frames omitted

canal-server日志报错:

2021-03-31 18:42:42.248 [Hashed wheel timer #1] WARN c.a.o.c.server.netty.handler.ClientAuthenticationHandler - channel:[id: 0x2ec089ff, /127.0.0.1:57614 => /127.0.0.1:11111] idle timeout exceeds, close channel to save server resources...

虽然根据 issue#640 可以知道是因为 idle timeout 设置的连接有效时间为一小时,超时就会报错 但是这个配置似乎是代码中写死的,不可以进行配置。 请问如何修改 idletimeout 的大小或者如何避免这个问题呢? 看了相关issue没有找到结论,希望能够有人帮助一下

原提问者GitHub用户yilongchuan

展开
收起
山海行 2023-04-27 18:32:28 180 0
1 条回答
写回答
取消 提交回答
  • SimpleCanalConnector里可以设置idleTimeout

    原回答者GitHub用户agapple

    2023-04-28 13:33:08
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何通过 Serverless 提高 Java 微服务治理效 立即下载
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
多IO线程优化版 立即下载