Skip to content

Commit

Permalink
Fix leak and test in 4.4 (#3674)
Browse files Browse the repository at this point in the history
* Fix leak

* Fix test
  • Loading branch information
Yurunsoft authored Sep 18, 2020
1 parent 24751f4 commit a10d844
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/server/master.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,10 @@ static void swServer_signal_handler(int sig)
swTraceLog(SW_TRACE_SERVER, "signal[%d] %s triggered in %d", sig, swSignal_str(sig), getpid());

swServer *serv = SwooleG.serv;
if (!SwooleG.running or !serv) {
return;
}

int status;
pid_t pid;
switch (sig)
Expand Down
1 change: 1 addition & 0 deletions tests/include/lib/src/DbWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SwooleTest;

use RuntimeException;
use Swoole\Coroutine\MySQL;

class DbWrapper
Expand Down
2 changes: 1 addition & 1 deletion tests/include/lib/src/ProcessManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function run($redirectStdout = false)
$waitInfo = Swoole\Process::wait(true);
$this->childStatus = $waitInfo['code'];
if (!in_array($waitInfo['signal'], $this->expectExitSignal)) {
throw new RuntimeException("Unexpected exit code {$waitInfo['signal']}");
throw new \RuntimeException("Unexpected exit code {$waitInfo['signal']}");
}

return true;
Expand Down

0 comments on commit a10d844

Please sign in to comment.