controller: fix that sender thread is never terminated

Empty q.get() is blocking send thread.
Because of this issue, datapath state never transit to DEAD.

This fixes commit 83e3709a0d.
  - controller: fix send_q draining
      83e3709a0d

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMADA Hideki
2013-02-24 12:56:22 +09:00
committed by FUJITA Tomonori
parent 19a8d21636
commit b083da401f

View File

@@ -196,10 +196,7 @@ class Datapath(object):
buf = self.send_q.get()
self.socket.sendall(buf)
finally:
q = self.send_q
self.send_q = None
while q.get():
pass
def send(self, buf):
if self.send_q: