diff --git a/control/server.py b/control/server.py index e497f11c..9d377588 100644 --- a/control/server.py +++ b/control/server.py @@ -70,6 +70,7 @@ def __init__(self, config): self.name = socket.gethostname() self.logger.info(f"Starting gateway {self.name}") + def __enter__(self): return self @@ -225,8 +226,9 @@ def _stop_spdk(self): self.logger.error(f"SPDK({self.name}) pid {self.spdk_process.pid} " f"already terminated, exit code: {return_code}") else: - self.logger.info(f"Terminating SPDK({self.name}) pid {self.spdk_process.pid}...") - self.spdk_process.terminate() + self.logger.info(f"Aborting SPDK({self.name}) pid {self.spdk_process.pid}...") + self.spdk_process.send_signal(signal.SIGABRT) + try: timeout = self.config.getfloat("spdk", "timeout") self.spdk_process.communicate(timeout=timeout)