From 159c8bb5d133fee2f42798f009a28fe074237f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 1 May 2017 16:12:36 +0300 Subject: [PATCH] Listen for only EPOLLIN events with listeners The example in the epoll(7) manpage only sets the EPOLLIN event flag. Although it is not explicitly stated that only EPOLLIN events arrive for sockets that are listening, any other types of events should not be relevant for listeners. --- server/core/dcb.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/core/dcb.cc b/server/core/dcb.cc index f8feb75ae..ad67d7c85 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -3451,6 +3451,12 @@ int poll_add_dcb(DCB *dcb) } else { + /** + * Listeners are always added in level triggered mode. This will cause + * new events to be generated as long as there is at least one connection + * to accept. + */ + events = EPOLLIN; ss_dassert(dcb->dcb_role == DCB_ROLE_SERVICE_LISTENER); new_state = DCB_STATE_LISTENING; }