mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 15:31:07 +00:00
Drop usages of Process:kill() with subprocesses parameter
we don't need this any more with console reader improvements, and this was not working correctly anyway. closes #5234
This commit is contained in:
parent
4bdd6410db
commit
9b43ddecbd
@ -343,7 +343,7 @@ JIT_WARNING
|
|||||||
|
|
||||||
if(ThreadManager::getInstance()->stopAll() > 0){
|
if(ThreadManager::getInstance()->stopAll() > 0){
|
||||||
$logger->debug("Some threads could not be stopped, performing a force-kill");
|
$logger->debug("Some threads could not be stopped, performing a force-kill");
|
||||||
Process::kill(Process::pid(), true);
|
Process::kill(Process::pid());
|
||||||
}
|
}
|
||||||
}while(false);
|
}while(false);
|
||||||
|
|
||||||
|
@ -1446,7 +1446,7 @@ class Server{
|
|||||||
|
|
||||||
private function forceShutdownExit() : void{
|
private function forceShutdownExit() : void{
|
||||||
$this->forceShutdown();
|
$this->forceShutdown();
|
||||||
Process::kill(Process::pid(), true);
|
Process::kill(Process::pid());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forceShutdown() : void{
|
public function forceShutdown() : void{
|
||||||
@ -1514,7 +1514,7 @@ class Server{
|
|||||||
}catch(\Throwable $e){
|
}catch(\Throwable $e){
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
$this->logger->emergency("Crashed while crashing, killing process");
|
$this->logger->emergency("Crashed while crashing, killing process");
|
||||||
@Process::kill(Process::pid(), true);
|
@Process::kill(Process::pid());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1668,7 +1668,7 @@ class Server{
|
|||||||
echo "--- Waiting $spacing seconds to throttle automatic restart (you can kill the process safely now) ---" . PHP_EOL;
|
echo "--- Waiting $spacing seconds to throttle automatic restart (you can kill the process safely now) ---" . PHP_EOL;
|
||||||
sleep($spacing);
|
sleep($spacing);
|
||||||
}
|
}
|
||||||
@Process::kill(Process::pid(), true);
|
@Process::kill(Process::pid());
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,4 +90,4 @@ while(!feof($socket)){
|
|||||||
//For simplicity's sake, we don't bother with a graceful shutdown here.
|
//For simplicity's sake, we don't bother with a graceful shutdown here.
|
||||||
//The parent process would normally forcibly terminate the child process anyway, so we only reach this point if the
|
//The parent process would normally forcibly terminate the child process anyway, so we only reach this point if the
|
||||||
//parent process was terminated forcibly and didn't clean up after itself.
|
//parent process was terminated forcibly and didn't clean up after itself.
|
||||||
Process::kill(Process::pid(), false);
|
Process::kill(Process::pid());
|
||||||
|
@ -125,7 +125,10 @@ final class Process{
|
|||||||
return count(ThreadManager::getInstance()->getAll()) + 2; //MainLogger + Main Thread
|
return count(ThreadManager::getInstance()->getAll()) + 2; //MainLogger + Main Thread
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function kill(int $pid, bool $subprocesses) : void{
|
/**
|
||||||
|
* @param bool $subprocesses @deprecated
|
||||||
|
*/
|
||||||
|
public static function kill(int $pid, bool $subprocesses = false) : void{
|
||||||
$logger = \GlobalLogger::get();
|
$logger = \GlobalLogger::get();
|
||||||
if($logger instanceof MainLogger){
|
if($logger instanceof MainLogger){
|
||||||
$logger->syncFlushBuffer();
|
$logger->syncFlushBuffer();
|
||||||
|
@ -49,7 +49,7 @@ class ServerKiller extends Thread{
|
|||||||
});
|
});
|
||||||
if(time() - $start >= $this->time){
|
if(time() - $start >= $this->time){
|
||||||
echo "\nTook too long to stop, server was killed forcefully!\n";
|
echo "\nTook too long to stop, server was killed forcefully!\n";
|
||||||
@Process::kill(Process::pid(), true);
|
@Process::kill(Process::pid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user