Commit dc40be43 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Make snf-dispatcher handle EINTR

snf-dispatcher supressed almost all exceptions and continued to process
new messages. However, this caused snf-dispatcher to ignore Ctl+C when
running in debug mode. This commit fixes this be exiting the retry loop
if a EINTR code is returned.
parent d308a53c
......@@ -69,6 +69,8 @@ from synnefo.logic import queues
from synnefo.db.models import Backend, pooled_rapi_client
import logging
import select
import errno
log = logging.getLogger("dispatcher")
log_amqp = logging.getLogger("amqp")
......@@ -119,9 +121,12 @@ class Dispatcher:
" to a different host. Verify that"
" snf-ganeti-eventd is running!!", timeout)
self.client.reconnect()
except SystemExit:
break
except KeyboardInterrupt:
except select.error as e:
if e[0] != errno.EINTR:
log.exception("Caught unexpected exception: %s", e)
else:
break
except (SystemExit, KeyboardInterrupt):
break
except Exception as e:
log.exception("Caught unexpected exception: %s", e)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment