In the abstract DNSService's _dns_handle_tcp method, error handling
is broken in a way that stops the main loop for handling TCP
connections.
Because socket.timeout is a subclass of socket.error, the error
handling block for socket.timeout is never reached.
Because of this, error handling of a TCP timeout is sent to the
socket.error block. Due to the way eventlet hijacks these errors,
the errorcode is not available and a KeyError is raised. This
KeyError interferes with the main loop because it is not caught.
Further improvement may include ensuring that these main loops
can never die due to unexpected exceptions.
Many thanks to Erik Andersson for pointing out the issue, which
was seemingly innocuous but ended up being the cause of our
problems.
Reviewed: https:/ /review. openstack. org/286557 /git.openstack. org/cgit/ openstack/ designate/ commit/ ?id=8de1f180c21 5be651095cc6ef7 dac0c2a13d66eb
Committed: https:/
Submitter: Jenkins
Branch: stable/kilo
commit 8de1f180c215be6 51095cc6ef7dac0 c2a13d66eb
Author: Rahman Syed <email address hidden>
Date: Thu Feb 25 14:12:53 2016 -0600
Improve error handling for TCP connections
In the abstract DNSService's _dns_handle_tcp method, error handling
is broken in a way that stops the main loop for handling TCP
connections.
Because socket.timeout is a subclass of socket.error, the error
handling block for socket.timeout is never reached.
Because of this, error handling of a TCP timeout is sent to the
socket.error block. Due to the way eventlet hijacks these errors,
the errorcode is not available and a KeyError is raised. This
KeyError interferes with the main loop because it is not caught.
Further improvement may include ensuring that these main loops
can never die due to unexpected exceptions.
Many thanks to Erik Andersson for pointing out the issue, which
was seemingly innocuous but ended up being the cause of our
problems.
Closes-bug: 1549980 42cbd56e4d296e0 83f8fcbbae5
Change-Id: I47e1260a0818cc