zachbr / Dis4IRC

A modern Discord <-> IRC bridge
MIT License
51 stars 18 forks source link

Bot does not reconnect if IRC connection dies for whatever reason #23

Closed RoboMWM closed 5 years ago

RoboMWM commented 5 years ago

1.0.2 release.

[22:34:25] [default] [WARN] - IRC connection closed: null reason
[22:34:25] [default] [INFO] - Will attempt to reconnect
java.io.IOException: An existing connection was forcibly closed by the remote host
        at sun.nio.ch.SocketDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:192)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
        at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1108)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:345)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)
[22:34:28] [io.netty.handler.ssl.SslHandler] [DEBUG] - [id: 0x83270abf, L:/10.0.2.4:53220 - R:irc.spi.gt/23.239.10.190:6697] HANDSHAKEN: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

The rest is your normal JDA stuff dropping. and resuming from time to time. Only this stuff was printed at this timeframe.

zachbr commented 5 years ago

It will attempt to, but I'm not aware of how many times it will try to. It has been fine for my use. This is probably something that's going to be temperamental to deal with in general.

zachbr commented 5 years ago

So the way this works currently is KICL fires an event and we handle the event and tell KICL to reconnect. In the last release we were on an older version, we're on a newer version in master now and I haven't had this problem since I updated it. I don't know if you've been running from master at all but I'd be interested to hear if you noticed any improvements.

RoboMWM commented 5 years ago

No I've been on release. Haven't bothered to download and run a gradle build yet.

Haven't had any IRC connection issues but often have IRC -> discord with an exception regarding network connectivity at random times. I think it recovers after 10 or so minutes, or after I restart the bridge.

RoboMWM commented 5 years ago

Network connectivity as in dumcord's API. I'll compile from master and get a log if it happens again, if desired.

zachbr commented 5 years ago

Please do, thanks

zachbr commented 5 years ago

This seems to have been resolved with the upgrade of the IRC lib.