mojira.dev
MC-63590

Watchdog shuts down server

To set the server watchdog to a higher time or switch it off:

Set max-tick-time in server.properties to a value higher than 60000 or to -1
https://minecraft.fandom.com/wiki/Server.properties#max-tick-time


The server crashes randomly. Most recent crash report attached.

Description: Watching Server

java.lang.Error
	at java.util.ArrayList.indexOf(ArrayList.java:298)
	at java.util.ArrayList.contains(ArrayList.java:281)
	at java.util.ArrayList.batchRemove(ArrayList.java:700)
	at java.util.ArrayList.removeAll(ArrayList.java:671)
	at aqa.i(SourceFile:1339)
	at ql.i(SourceFile:470)
	at net.minecraft.server.MinecraftServer.y(SourceFile:605)
	at ph.y(SourceFile:303)
	at net.minecraft.server.MinecraftServer.x(SourceFile:529)
	at net.minecraft.server.MinecraftServer.run(SourceFile:445)
	at java.lang.Thread.run(Thread.java:744)

Update: This crash appears to be caused by a new “feature“ called the Server Watchdog. This is a thread that kills the server when there is too much lag. Sometimes, but by no means always, this is logged accordingly:

2014-07-26 21:06:11 [Server Watchdog/FATAL]: A single server tick took 35.28 seconds (should be max 0.05)
2014-07-26 21:06:11 [Server Watchdog/FATAL]: Considering it to be crashed, server will forcibly shutdown.
2014-07-26 21:06:13 [Server Watchdog/ERROR]: This crash report has been saved to: /opt/wurstmineberg/server/./crash-reports/crash-2014-07-26_23.06.12-server.txt

Thanks @unknown for finding this.

Linked issues

MC-7007 Enderman Name Tags are not high enough Resolved MC-63624 Server Crash Resolved MC-63668 Server Crash when using /fill Resolved MC-63671 Server sometimes crashes with high randomTickSpeed Resolved MC-63726 Watching Server java.lang.Error Resolved

Attachments

Comments 97

Fenhl (Max Dominik Weber)

About a dozen crashes later, I am fairly certain that the crash happens when a certain part of the Nether is unloaded, ~30 seconds after using a specific portal to the Overworld. The region of the Nether in question has a MC-15019 style item dupe in it, so the same bug that causes the dupe may be responsible for this crash.

Anthony Martin

Typical log entry prior to watchdog kicking in:

[20:05:23] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 30556ms behind, skipping 611 tick(s)
[20:05:26] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2918ms behind, skipping 58 tick(s)
[20:05:59] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 3954ms behind, skipping 79 tick(s)
[20:06:49] [Server Watchdog/FATAL]: A single server tick took 44.60 seconds (should be max 0.05)
[20:06:49] [Server Watchdog/FATAL]: Considering it to be crashed, server will forcibly shutdown.
[20:06:51] [Server Watchdog/ERROR]: This crash report has been saved to: /Users/steve/Minecraft/Swim3/./crash-reports/crash-2014-07-24_20.06.51-server.txt
[20:06:51] [Server Shutdown Thread/INFO]: Stopping server
Anthony Martin

The criteria Watchdog is using might be a little overzealous. It'd be nice if instead of arbitrarily stopping the server, if there was a way for it to execute an external script, that'd be cool.

JVM offers such an option, e.g.:

-XX:OnOutOfMemoryError=/Users/steve/minecraft/scripts/jvm_on_out_of_memory.sh

If we were allowed the option to execute our own script, we could kick all of the players, save, then stop the server. Often, when the server is told to just stop during a overloaded condition, it just sits there for a long time. In my experience, kick/save/stop is typically more reliable than just stop, during an overloaded condition.

Anthony Martin

Also, I don't think it's always appropriate for the server to shut down due to being behind. There are cases where network conditions can cause the server to fall behind. When the network conditions clear up, the server can catch up, if it weren't for the watchdog. Just considering the server crashed because of network conditions seems like an overreaction.

Fenhl (Max Dominik Weber)

Okay, so what I described above is only one very specific cause of a much more general problem. Loading and unloading the Nether causes lag, and the watchdog kills the server when there's too much lag. I can see why a behavior such as this could be desirable, but in my opinion the threshold is much too low and the watchdog should be optional.

87 more comments

@unknown:

To set the server watchdog to a higher time or switch it off:
Set max-tick-time in server.properties to a value higher than 60000 or to -1

This should fix your problem.

This creates a huge amount of lagg. I already tried it.

Warren Liddell

Then it is quite apparent your server cannot handle what you got running, i would also suggest you add more RAM ..8GB is rather small even for 5-10 ppl .. i would'nt run less than 16GB for a Vanilla server these days imho

I don't understand why so many issues reporting the server performance drop are getting linked to this one. The problem isn't the watchdog itself, but the fact that lately in 1.14 snapshots servers are not optimized and often freeze for a few seconds every minute, sometimes the freeze is so long it takes over a minute resulting in watchdog stopping the server. Neither CPU nor RAM are the problem here as I tested it on machines with different hardware and systems and the problem is the same with every single one of them.

If the server timeout stops when you update the console window (type a key, right click, etc) and you cant see it happening until you update the window, what helped for me is turning off "quick edit mode".

(This is for windows only, i believe). You have to right click on the top bar of the console window while server is running, then go to defaults and turn off quick edit mode. Then restart the server (resetting console window).

 

No random timeouts anymore!

My problem was that the server was running completely fine (20tps, 10-20 mspt), but would randomly timeout. This seems to have fixed it.

 

Fenhl (Max Dominik Weber)

(Unassigned)

Unconfirmed

crash, server

Minecraft 14w30c, Minecraft 14w31a

Retrieved