Skip to content

Commit

Permalink
Merge pull request #8386 from rtibbles/windows_no_sigkill
Browse files Browse the repository at this point in the history
Don't use SIGKILL on windows as it doesn't exist.
  • Loading branch information
rtibbles committed Sep 6, 2021
2 parents 62aa187 + fb99ef9 commit f1c4afb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kolibri/utils/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,15 @@ def wait_for_status(target, timeout=10):
return False


# The SIGKILL signal does not exist on windows
# We use CTRL_C_EVENT instead, as it is intended
# to be passed to the os.kill command.
if sys.platform == "win32":
SIGKILL = signal.CTRL_C_EVENT
else:
SIGKILL = signal.SIGKILL


def stop():
"""
Stops the kolibri server
Expand All @@ -499,7 +508,7 @@ def stop():
if pid_exists(pid):
logger.debug("Process wth pid %s still exists; attempting a SIGKILL." % pid)
try:
os.kill(pid, signal.SIGKILL)
os.kill(pid, SIGKILL)
except SystemError as e:
logger.debug(
"Received an error while trying to kill the Kolibri process: %s" % e
Expand Down

0 comments on commit f1c4afb

Please sign in to comment.