MCPcopy Create free account
hub / github.com/Teneted/Tenet / run

Method run

src/main/java/org/spigotmc/WatchdogThread.java:54–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 }
53
54 @Override
55 public void run()
56 {
57 while ( !stopping )
58 {
59 //
60 if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime )
61 {
62 Logger log = Bukkit.getServer().getLogger();
63 log.log( Level.SEVERE, "------------------------------" );
64 log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Spigot bug." );
65 log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
66 log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
67 log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
68 log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
69 log.log( Level.SEVERE, "If you are unsure or still think this is a Spigot bug, please report to https://www.spigotmc.org/" );
70 log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
71 log.log( Level.SEVERE, "Spigot version: " + Bukkit.getServer().getVersion() );
72 //
73 if ( net.minecraft.world.World.lastPhysicsProblem != null )
74 {
75 log.log( Level.SEVERE, "------------------------------" );
76 log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
77 log.log( Level.SEVERE, "near " + net.minecraft.world.World.lastPhysicsProblem );
78 }
79 //
80 log.log( Level.SEVERE, "------------------------------" );
81 log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" );
82 dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
83 log.log( Level.SEVERE, "------------------------------" );
84 //
85 log.log( Level.SEVERE, "Entire Thread Dump:" );
86 ThreadInfo[] threads = ManagementFactory.getThreadMXBean().dumpAllThreads( true, true );
87 for ( ThreadInfo thread : threads )
88 {
89 dumpThread( thread, log );
90 }
91 log.log( Level.SEVERE, "------------------------------" );
92
93 if ( restart && !MinecraftServer.getServer().hasStopped() )
94 {
95 RestartCommand.restart();
96 }
97 break;
98 }
99
100 try
101 {
102 sleep( 10000 );
103 } catch ( InterruptedException ex )
104 {
105 interrupt();
106 }
107 }
108 }
109
110 private static void dumpThread(ThreadInfo thread, Logger log)
111 {

Callers 6

runAndTickMethod · 0.45
setupLaunchHandlerMethod · 0.45
beginModScanMethod · 0.45
beforeStartMethod · 0.45
ifPresentOrElseMethod · 0.45
waitForScanToCompleteMethod · 0.45

Calls 10

monotonicMillisMethod · 0.95
getServerMethod · 0.95
dumpThreadMethod · 0.95
restartMethod · 0.95
getLoggerMethod · 0.65
getVersionMethod · 0.65
getIdMethod · 0.65
getServerMethod · 0.65
sleepMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected