cc-tweaked / CC-Tweaked

Just another ComputerCraft fork
https://tweaked.cc
917 stars 212 forks source link

```IllegalStateException``` while running cloudcatcher and TLCO #1803

Closed powerboat9 closed 5 months ago

powerboat9 commented 5 months ago

Minecraft Version

1.20.x

Version

1.110.1

Details

2024-04-23_18 48 20

This happened while I was AFK on switchcraft. The following files may be relevant:

cloud.lua startup.lua prep.lua lib/homura.lua lib/hub.lua

SquidDev commented 5 months ago

I suspect this is just an internal netty error, but we should do a better job of what error we expose to the user.

powerboat9 commented 5 months ago

Internal netty error?

SquidDev commented 5 months ago

Ahh, managed to get the logs. No, this is a thread-safety issue with multiple classes using the CharsetDecoder. Hadn't properly registered that these are not thread-safe. This should be easy to fix!

java.lang.IllegalStateException: Current state = RESET, new state = FLUSHED
        at java.nio.charset.CharsetDecoder.throwIllegalStateException(Unknown Source) ~[?:?]
        at java.nio.charset.CharsetDecoder.flush(Unknown Source) ~[?:?]
        at java.nio.charset.CharsetDecoder.decode(Unknown Source) ~[?:?]
        at dan200.computercraft.core.apis.http.websocket.WebsocketHandle.send(WebsocketHandle.java:90) ~[cc-tweaked-1.20.1-fabric-1.109.2.jar:?]
        at dan200.computercraft.core.asm.LuaMethodSupplier.lambda$static$0(LuaMethodSupplier.java:27) ~[cc-tweaked-1.20.1-fabric-1.109.2.jar:?]
        at dan200.computercraft.core.lua.BasicFunction.invoke(BasicFunction.java:45) ~[cc-tweaked-1.20.1-fabric-1.109.2.jar:?]
        at org.squiddev.cobalt.function.VarArgFunction.call(VarArgFunction.java:60) ~[cc_tweaked_cobalt-0.8.1-5f38dd5922b07ad.jar:?]