mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix #1206, dispose ingester while server quiting. 3.0.111
This commit is contained in:
parent
a6f88805f3
commit
23ece94064
9 changed files with 77 additions and 12 deletions
|
|
@ -327,3 +327,28 @@ void SrsProcess::fast_stop()
|
|||
return;
|
||||
}
|
||||
|
||||
void SrsProcess::fast_kill()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
if (!is_started) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pid <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (kill(pid, SIGKILL) < 0) {
|
||||
ret = ERROR_SYSTEM_KILL;
|
||||
srs_warn("ignore fast kill process failed, pid=%d. ret=%d", pid, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to wait pid to avoid zombie FFMEPG.
|
||||
int status = 0;
|
||||
waitpid(pid, &status, WNOHANG);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue