From 3a4eda82aa314dc48fbb3005b51ace7cdfa50ee9 Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Tue, 9 Mar 2021 14:54:15 +0800 Subject: [PATCH] signal int handler Signed-off-by: zhoufeng --- mindspore/ccsrc/runtime/device/ascend/signal_util.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/signal_util.cc b/mindspore/ccsrc/runtime/device/ascend/signal_util.cc index aecb2ec722..22a02871de 100644 --- a/mindspore/ccsrc/runtime/device/ascend/signal_util.cc +++ b/mindspore/ccsrc/runtime/device/ascend/signal_util.cc @@ -46,6 +46,8 @@ void SignalGuard::RegisterHandlers() { void SignalGuard::IntHandler(int, siginfo_t *, void *) { kernel::AscendKernelBuildClient::Instance().Close(); - MS_LOG_EXCEPTION << "KeyboardInterrupt"; + int this_pid = getpid(); + MS_LOG(WARNING) << "Process " << this_pid << " receive KeyboardInterrupt signal."; + (void)kill(this_pid, SIGTERM); } } // namespace mindspore