Skip to content

Commit 591b576

Browse files
committed
Set instances restart to SIGKILL by default
Found that some of the instances could not be killed with SIGTERM signal and it really needed SIGKILL signal to be sure that the instance would be terminated. Otherwise some tests may fail, like: No output during 120 seconds. Will abort after 120 seconds without output. List of workers not reporting the status: - 001_engine [engine/json.test.lua, memtx] at var/001_engine/json.result:598 Test hung! Result content mismatch: --- engine/json.result Fri Nov 6 08:35:45 2020 +++ var/001_engine/json.result Mon Nov 9 03:48:40 2020 @@ -596,248 +596,3 @@ - ok ... test_run:cmd("restart server default") -engine = test_run:get_cfg('engine') ---- -… Test run uses 'tarantoolctl' tool for commands in format "restart server default", and 'tarantoolctl' had only single way to kill it using SIGTERM signal. To implement ability to use it with SIGKILL was added additional non-mandatory option to stop and restart 'tarantoolctl' commands, like: tarantoolctl stop <instance> [--signal=SIGKILL] tarantoolctl restart <instance> [--signal=SIGKILL] This options didn't change the backward compatibility of 'tarantoolctl' tool, but gave test-run ability to stop and restart instances with SIGKILL signal: tarantoolctl restart <instance> --signal=9 It helped to fix the issue with hanging instances in the needed tests.
1 parent 96dea99 commit 591b576

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/tarantool_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ def copy_files(self):
776776
self.vardir)
777777

778778
def prepare_args(self, args=[]):
779-
return [self.ctl_path, 'start', os.path.basename(self.script)] + args
779+
return [self.ctl_path, 'restart', os.path.basename(self.script)] + args \
780+
+ ['--signal=9']
780781

781782
def pretest_clean(self):
782783
# Don't delete snap and logs for 'default' tarantool server
@@ -1003,7 +1004,7 @@ def kill_old_server(self, silent=True):
10031004
color_log(' Found old server, pid {0}, killing ...'.format(pid),
10041005
schema='info')
10051006
try:
1006-
os.kill(pid, signal.SIGTERM)
1007+
os.kill(pid, signal.SIGKILL)
10071008
except OSError:
10081009
pass
10091010
self.wait_until_stopped(pid)

0 commit comments

Comments
 (0)