MrCrayfish / MrCrayfishFurnitureMod-Refurbished

The next generation of MrCrayfish's Furniture Mod, written from the ground up with brand new models.
https://www.curseforge.com/minecraft/mc-mods/refurbished-furniture
MIT License
29 stars 10 forks source link

Light Switch Block Entity Crashes Server #27

Open brianclogan opened 3 weeks ago

brianclogan commented 3 weeks ago

It appears that on 1.20.1 fabric, the light switch block, it can cause a crash when updating the tick pattern.

Full error log from the crash:

java.lang.Error: Watchdog
    at java.base@21.0.4/jdk.internal.misc.Unsafe.park(Native Method)
    at java.base@21.0.4/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
    at net.minecraft.class_1255.method_20813(class_1255.java:151)
    at net.minecraft.class_1255.method_18857(class_1255.java:141)
    at net.minecraft.class_3215.method_12121(class_3215.java:140)
    at net.minecraft.class_3215.method_20586(class_3215.java:123)
    at net.minecraft.class_3215$$Lambda/0x000071a972f16ee0.get(Unknown Source)
    at java.base@21.0.4/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
    at net.minecraft.class_1255.method_18859(class_1255.java:156)
    at net.minecraft.class_3215$class_4212.method_18859(class_3215.java:564)
    at net.minecraft.class_1255.method_16075(class_1255.java:130)
    at net.minecraft.class_3215$class_4212.method_16075(class_3215.java:573)
    at net.minecraft.class_1255.method_18857(class_1255.java:139)
    at net.minecraft.class_3215.method_12121(class_3215.java:140)
    at net.minecraft.class_1937.method_8402(class_1937.java:204)
    at net.minecraft.class_4538.method_22342(class_4538.java:156)
    at net.minecraft.class_1937.method_8497(class_1937.java:198)
    at net.minecraft.class_1937.method_8320(class_1937.java:370)
    at net.minecraft.class_7159$class_7161.method_41707(class_7159.java:131)
    at net.minecraft.class_7159.method_41702(class_7159.java:78)
    at net.minecraft.class_7159.method_41706(class_7159.java:65)
    at net.minecraft.class_7159.method_41705(class_7159.java:47)
    at net.minecraft.class_3218.method_8452(class_3218.java:1018)
    at net.minecraft.class_3218.method_8408(class_3218.java:1433)
    at net.minecraft.class_1937.method_30092(class_1937.java:246)
    at net.minecraft.class_1937.method_8652(class_1937.java:213)
    at com.mrcrayfish.furniture.refurbished.blockentity.LightswitchBlockEntity.setNodePowered(LightswitchBlockEntity.java:50)
    at com.mrcrayfish.furniture.refurbished.electricity.IModuleNode.updateNodePoweredState(IModuleNode.java:39)
    at com.mrcrayfish.furniture.refurbished.electricity.IModuleNode.moduleTick(IModuleNode.java:58)
    at com.mrcrayfish.furniture.refurbished.electricity.ElectricityTicker$$Lambda/0x000071a972c8af90.accept(Unknown Source)
    at com.mrcrayfish.furniture.refurbished.electricity.ElectricityTicker.tickSet(ElectricityTicker.java:78)
    at com.mrcrayfish.furniture.refurbished.electricity.ElectricityTicker.tick(ElectricityTicker.java:61)
    at net.minecraft.class_1937.handler$eic000$refurbished_furniture$refurbishedFurniture$TickBlockEntitiesHead(class_1937.java:4553)
    at net.minecraft.class_1937.method_18471(class_1937.java)
    at net.minecraft.class_3218.method_18765(class_3218.java:390)
    at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:897)
    at net.minecraft.class_3176.method_3813(class_3176.java:283)
    at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:824)
    at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:671)
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265)
    at net.minecraft.server.MinecraftServer$$Lambda/0x000071a97274c000.run(Unknown Source)
    at java.base@21.0.4/java.lang.Thread.runWith(Thread.java:1596)
    at java.base@21.0.4/java.lang.Thread.run(Thread.java:1583)

This has happened twice within 5 minutes on our server. Any other information I can provide, let me know and I will be happy to share what I am able to.

MrCrayfish commented 2 weeks ago

Can you please provide the full crash log? I would use a service like https://mclo.gs/ to share it as it will remove sensitive information like IPs.

brianclogan commented 2 weeks ago

Will do! Sorry for the delay, I'll get that though when I am home. This whole weekend was just focused on getting the server back to a stable state.

brianclogan commented 2 weeks ago

@MrCrayfish https://mclo.gs/8FNhrAZ Sorry again for the delay! If you end up finding that it might be something else, more than happy to share any other logs with you.

MrCrayfish commented 2 weeks ago

Just based on the log, I assume you are using a Fabric + Spigot hybrid server? Although the error looks to be triggered by my mod, it may actually be your server software. I searched up Watchdog, and it seems like a feature built into some Minecraft server softwares. It purposely crashes the server if the time it takes to perform a game tick surpasses the max-tick-time defined in the server configuration, in order to avoid corruption. Try going through your server configuration to boost this value. Adding mods will definitely slow your tick rate, and the default max-tick-time may be only suitable for a minimal amount of mods.

MrCrayfish commented 2 weeks ago

Might not be exactly related by here is the article I found on Watchdog https://help.ggservers.com/en-us/article/what-is-watchdog-and-why-does-it-crash-my-server-n8aex/

brianclogan commented 1 week ago

It's just Fabric, no spigot :)

MrCrayfish commented 1 week ago

In server.properties, make sure max-tick-time is not a low number

brianclogan commented 2 days ago

Apologies for the late reply @MrCrayfish! I am not getting any emails from Github right now for some reason. (I will be more diligent on checking notifications on Github though)

Max tick time is set to 60000ms.