From 01ad7e656f99ab74af46702f7c3814a18e05649b Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Thu, 27 Jan 2022 20:45:03 -0800 Subject: [PATCH] quickfix: for /cancel immediate crawl cancelation, send SIGABRT instead of SIGUSR1 --- backend/dockerman.py | 5 +++-- backend/k8sman.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/dockerman.py b/backend/dockerman.py index 7f420607..c5eb2dc9 100644 --- a/backend/dockerman.py +++ b/backend/dockerman.py @@ -227,7 +227,8 @@ class DockerManager: return running async def stop_crawl(self, crawl_id, aid, graceful=True): - """ Stop crawl, if not graceful, issue SIGUSR1 to indicate cancelation """ + """Stop crawl, if not graceful, issue SIGABRT to indicate immediate + cancelation on next SIGTERM""" result = None @@ -238,7 +239,7 @@ class DockerManager: return None if not graceful: - await container.kill(signal="SIGUSR1") + await container.kill(signal="SIGABRT") result = self._make_crawl_for_container(container, "canceled", True) else: result = True diff --git a/backend/k8sman.py b/backend/k8sman.py index 89184005..2df34234 100644 --- a/backend/k8sman.py +++ b/backend/k8sman.py @@ -381,7 +381,7 @@ class K8SManager: """Attempt to stop crawl, either gracefully by issuing a SIGTERM which will attempt to finish current pages - OR, abruptly by first issueing a SIGINT, followed by SIGTERM, which + OR, abruptly by first issueing a SIGABRT, followed by SIGTERM, which will terminate immediately""" job = await self.batch_api.read_namespaced_job( @@ -531,7 +531,7 @@ class K8SManager: return suspend, schedule async def _send_sig_to_pods(self, pods, aid): - command = ["kill", "-s", "SIGUSR1", "1"] + command = ["kill", "-s", "SIGABRT", "1"] interrupted = False try: