From 27be9ceb74cc37dde6a8bbe5ff486fa2ee9671b5 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Thu, 5 Aug 2010 14:48:12 -0400 Subject: [PATCH] commands.process: return immediately when terminating process, without having to deal with the queue. otherwise, we have to block for $smalldelay between putting and getting the item, since queue putting is not instantaneous and sometimes we would get 'nothing returned' instead of the timeout message. --- src/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands.py b/src/commands.py index 8b1994faf..674b631f4 100644 --- a/src/commands.py +++ b/src/commands.py @@ -90,7 +90,7 @@ def process(f, *args, **kwargs): p.join(timeout) if p.is_alive(): p.terminate() - q.put("%s aborted due to timeout." % (p.name,)) + return "%s aborted due to timeout." % (p.name,) try: v = q.get(block=False) except Queue.Empty: