Added failsafe for ServerMonitor.
This commit is contained in:
parent
1aecc9505c
commit
a292fdb3c5
@ -311,6 +311,8 @@ public class ServerMonitor
|
||||
int processWaits = 0;
|
||||
|
||||
while (_processes.size() > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (Iterator<ProcessRunner> iterator = _processes.iterator(); iterator.hasNext();)
|
||||
{
|
||||
@ -328,6 +330,11 @@ public class ServerMonitor
|
||||
if (pr.isDone())
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
if (_processes.size() > 0)
|
||||
{
|
||||
@ -342,7 +349,7 @@ public class ServerMonitor
|
||||
}
|
||||
}
|
||||
|
||||
if (processWaits >= 10)
|
||||
if (processWaits >= 5)
|
||||
{
|
||||
log("Killing stale processes.");
|
||||
|
||||
@ -351,6 +358,8 @@ public class ServerMonitor
|
||||
iterator.next().abort();
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
_processes.clear();
|
||||
}
|
||||
|
||||
processWaits++;
|
||||
|
Loading…
Reference in New Issue
Block a user