From a6c16894ffa6f4c4b934f8a5378b6613632ae5ac Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 29 Jan 2021 09:22:37 +0100 Subject: [PATCH] worker_task: log something when we receive an abort request --- src/server/worker_task.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/worker_task.rs b/src/server/worker_task.rs index 4a73ff0b..3e2887f5 100644 --- a/src/server/worker_task.rs +++ b/src/server/worker_task.rs @@ -738,7 +738,11 @@ impl WorkerTask { /// Request abort pub fn request_abort(&self) { eprintln!("set abort flag for worker {}", self.upid); - self.abort_requested.store(true, Ordering::SeqCst); + + let prev_abort = self.abort_requested.swap(true, Ordering::SeqCst); + if !prev_abort { // log abort one time + self.log(format!("received abort request ...")); + } // noitify listeners let mut data = self.data.lock().unwrap(); loop {