[Tarantool-patches] [PATCH v1] tarantoolctl fails to stop server

Alexander V. Tikhonov avtikhon at tarantool.org
Sun Aug 16 23:41:38 MSK 2020


When server process couldn't be stopped with SIGTERM as described in
[1], then tarantoolctl didn't check its status and returned success
exit code. To fix it, check of the process after SIGTERM send should
be added and if the process was still alive than it should be killed
with SIGKILL. Also some time delay added before the process status
check to be sure that it completely gone.

Closed #5245

[1] - https://github.com/tarantool/tarantool/issues/5244
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5245-tarantoolctl-kills
Issue: https://github.com/tarantool/tarantool/issues/5244

 extra/dist/tarantoolctl.in | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index 90caf58ad..7bf3808f8 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -600,6 +600,15 @@ local function stop()
         fio.unlink(pid_file)
         return 1
     end
+    fiber.sleep(1)
+    if fio.stat(pid_file) ~= nil then
+        log.info("Kill not terminated process %d", pid)
+        if ffi.C.kill(pid, 9) < 0 then
+            log.error("Can't kill process %d: %s", pid, errno.strerror())
+            fio.unlink(pid_file)
+            return 1
+        end
+    end
 
     return 0
 end
-- 
2.17.1



More information about the Tarantool-patches mailing list