这是一个小型的服务端模组,当服务器的 Watchdog 系统因服务器死锁或长时间卡住而将其终止时,该模组会使日志显示更多信息。崩溃报告日志现在将显示在服务器死锁时正在运行的所有代码。换句话说,它将显示所有线程的完整堆栈跟踪,而不是通常被截断(缩短)的版本。
从理论上讲,这应该有助于诊断是什么模组代码或 mixin 导致了“非主线程”卡住。当一个线程卡住时,服务器主线程会被阻塞,如果它保持阻塞状态过久,Watchdog 就会终止它,因为一个 tick 花费了太长时间来完成。它并不能解决所有的死锁问题。 但它可能会为你提供足够的信息来追踪导致某些死锁的原因。
下图是该模组安装前后的示例(画廊标签页能更好地展示图片):

是的,你可以在整合包中发布此模组。 客户端也可以安装此模组,但由于 Watchdog 系统仅在服务器上运行,因此它在客户端上不会有任何作用。你也可以仅在服务端安装此模组。未安装此模组的客户端仍然可以连接。
注意 1: NeoForge 20.4.107 及更高版本已合并此模组!对于 MC 1.20.4 或更高版本,你不需要在 NeoForge 中使用此模组!
注意 2: Fabric API 0.104.0+1.21.2 及更高版本已合并此模组!对于 MC 1.21.2 或更高版本,你不需要在 Fabric 中使用此模组!
This is a tiny server-sided mod that makes it so that the logs show more information when the Watchdog system on the server has killed the server due to being deadlocked or stuck so long. The crash report log will now show all of the code that was running at the time of the deadlocked server. In other words, the full stacktrace of all threads instead of the normally truncated (shortened) version.
In theory, this should help with diagnosing what modded code or mixin has caused an "off-thread" to lock up. When a thread locks up, the server thread gets stuck and if it remains stuck for so long, the Watchdog kills it because a tick took too long to complete. It won't help solve all deadlock issues. But it might get you just enough info to track down the cause of a few deadlocks.
Image below is an example of before and after this mod is put on (Gallery tab shows image better):

Yes you may ship this mod in a modpack. The client can also have this mod on but it won't do anything on client since the Watchdog system is only ran on servers. You can also run servers with this mod only on the server. Clients without this mod can still connect.
NOTE 1: NeoForge 20.4.107 and newer already has this mod merged into it! You do not need this mod in NeoForge for 1.20.4 MC or newer!
NOTE 2: Fabric API 0.104.0+1.21.2 and newer already has this mod merged into it! You do not need this mod in Fabric for 1.21.2 MC or newer!
评论 0
登录后参与评分
还没有评论,来抢沙发吧