Commit 4f16b4a0 authored by Guido Trotter's avatar Guido Trotter
Browse files

ConfdAsyncUDPServer: handle signals at read time

Currently if a signal is delivered during an attempted read, an
exception is logged in the logfile. There is no need for this, so we
handle this case explicitely.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 7a0156dc
......@@ -33,6 +33,7 @@ import asyncore
import socket
import pyinotify
import time
import errno
from optparse import OptionParser
......@@ -77,7 +78,15 @@ class ConfdAsyncUDPServer(asyncore.dispatcher):
# this method is overriding an asyncore.dispatcher method
def handle_read(self):
payload_in, address = self.recvfrom(4096)
payload_in, address = self.recvfrom(4096)
except socket.error, err:
if err.errno == errno.EINTR:
# we got a signal while trying to read. no need to do anything,
# handle_read will be called again if there is data on the socket.
ip, port = address
payload_out = self.processor.ExecQuery(payload_in, ip, port)
if payload_out is not None:
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