From 6ab4d3c88658b8bce1772901b2e139957019ba0f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 25 Apr 2017 16:48:35 -0400 Subject: [PATCH] Add a recourse to drain queue While it may not have been possible in eventlet for this to happen, strictly speaking if it were a thread, it could exit during check for liveness and leave data on the queue. To be careful, also drain the queue after all children dead. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index ff8adbb2..f4278a90 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -290,6 +290,15 @@ def perform_requests(operator, nodes, element, cfg, inputdata): for t in list(livingthreads): if t.dead: livingthreads.discard(t) + try: + # drain queue if a thread put something on the queue and died + while True: + datum = resultdata.get_nowait() + if datum != 'Done': + yield datum + except queue.Empty: + pass + def perform_request(operator, node, element,