CC: Tweaked

CC: Tweaked

57M Downloads

Error handling HTTP response

Ale32bit opened this issue · 1 comments

commented

Minecraft Version

1.20.1

Version

1.113.1

Details

The console get spammed with the following error:

[ComputerCraft-Netty-2/ERROR] [da.co.co.ap.ht.re.HttpRequestHandler/COMPUTER_ERROR.HTTP]: Error handling HTTP response
java.net.SocketException: Connection reset
        at sun.nio.ch.SocketChannelImpl.throwConnectionReset(Unknown Source) ~[?:?] {}
        at sun.nio.ch.SocketChannelImpl.read(Unknown Source) ~[?:?] {}
        at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:258) ~[netty-buffer-4.1.82.Final.jar%2380!/:4.1.82.Final] {}
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[netty-buffer-4.1.82.Final.jar%2380!/:4.1.82.Final] {}
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final] {}
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final] {}
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final] {}
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final] {}
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final] {}
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final] {}
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final] {}
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final] {}
        at java.lang.Thread.run(Unknown Source) ~[?:?] {re:mixin}

This is running on a public server so I have no idea how to reproduce.

commented

Yeah, I'm not quite sure what to do about this. Logging HTTP failures often is useful (especially when debugging SSL failures), but obviously not to the point of spamming the logs.

We should probably:

  • Include the (sanitised) URL we're trying to connect to, and computer ID.
  • Rate limit how fast we log error messages. Either via log4j or in Java.
  • Maybe just drop SocketException errors. I'm less sure about this one — they might be useful at times.