From 289c3a4d0f3f66dbbb92bd81512ab7065f15b36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 9 May 2019 13:39:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20handling=20of=20Empty=20ex?= =?UTF-8?q?ception=20in=20send=20loop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3096 --- src/octoprint/util/comm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 2334239dc..e83b9d703 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -3099,7 +3099,13 @@ class MachineCom(object): while self._send_queue_active: try: # wait until we have something in the queue - entry = self._send_queue.get() + try: + entry = self._send_queue.get() + except queue.Empty: + # I haven't yet been able to figure out *why* this can happen but according to #3096 and SERVER-2H + # an Empty exception can fly here due to resend_active being True but nothing being in the resend + # queue of the send queue. So we protect against this possibility... + continue try: # make sure we are still active