From 350a39b88650b4c29ae46e3a8e2050236284b0aa Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Fri, 14 May 2021 09:42:42 +0300 Subject: [PATCH] Fix shutting down a Task immediately after creation might block --- clearml/utilities/process/mp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clearml/utilities/process/mp.py b/clearml/utilities/process/mp.py index a5cdccea..39b590ae 100644 --- a/clearml/utilities/process/mp.py +++ b/clearml/utilities/process/mp.py @@ -61,8 +61,9 @@ class SafeQueue(object): return self._q.empty() and (not self._internal_q or self._internal_q.empty()) def is_pending(self): + # check if we have pending requests to be pushed (it does not mean they were pulled) # only call from main put process - return self._q_size > 0 or not self.empty() + return self._q_size > 0 def close(self, event): # wait until all pending requests pushed