quickfix: for /cancel immediate crawl cancelation, send SIGABRT instead of SIGUSR1

This commit is contained in:
Ilya Kreymer 2022-01-27 20:45:03 -08:00
parent 28b59130a6
commit 01ad7e656f
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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: