Patchwork [4,of,4] commandserver: use SOMAXCONN as queue size of pending connections

login
register
mail settings
Submitter Yuya Nishihara
Date July 17, 2016, 2:03 p.m.
Message ID <0251417a7d39e623df71.1468764182@mimosa>
Download mbox | patch
Permalink /patch/15913/
State Accepted
Headers show

Comments

Yuya Nishihara - July 17, 2016, 2:03 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1468648138 -32400
#      Sat Jul 16 14:48:58 2016 +0900
# Node ID 0251417a7d39e623df71746f29daff55425ee415
# Parent  80953463c7d704337c646e2c730318f438c2098e
commandserver: use SOMAXCONN as queue size of pending connections

The old value 5 was arbitrary chosen. Since there's no practical reason to
limit the backlog, this patch simply uses SOMAXCONN as a value large enough.
Jun Wu - July 17, 2016, 10:04 p.m.
These are all looking good. I have marked them as pre-reviewed.

Excerpts from Yuya Nishihara's message of 2016-07-17 23:03:02 +0900:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1468648138 -32400
> #      Sat Jul 16 14:48:58 2016 +0900
> # Node ID 0251417a7d39e623df71746f29daff55425ee415
> # Parent  80953463c7d704337c646e2c730318f438c2098e
> commandserver: use SOMAXCONN as queue size of pending connections
> 
> The old value 5 was arbitrary chosen. Since there's no practical reason to
> limit the backlog, this patch simply uses SOMAXCONN as a value large enough.
> 
> diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
> --- a/mercurial/commandserver.py
> +++ b/mercurial/commandserver.py
> @@ -440,7 +440,7 @@ class unixforkingservice(object):
>      def init(self):
>          self._sock = socket.socket(socket.AF_UNIX)
>          self._servicehandler.bindsocket(self._sock, self.address)
> -        self._sock.listen(5)
> +        self._sock.listen(socket.SOMAXCONN)
>          o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
>          self._oldsigchldhandler = o
>          self._servicehandler.printbanner(self.address)
Augie Fackler - July 18, 2016, 11:51 a.m.
On Sun, Jul 17, 2016 at 11:04:24PM +0100, Jun Wu wrote:
> These are all looking good. I have marked them as pre-reviewed.
>
> Excerpts from Yuya Nishihara's message of 2016-07-17 23:03:02 +0900:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya@tcha.org>
> > # Date 1468648138 -32400
> > #      Sat Jul 16 14:48:58 2016 +0900
> > # Node ID 0251417a7d39e623df71746f29daff55425ee415
> > # Parent  80953463c7d704337c646e2c730318f438c2098e
> > commandserver: use SOMAXCONN as queue size of pending connections

Queued, thanks.

> >
> > The old value 5 was arbitrary chosen. Since there's no practical reason to
> > limit the backlog, this patch simply uses SOMAXCONN as a value large enough.
> >
> > diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
> > --- a/mercurial/commandserver.py
> > +++ b/mercurial/commandserver.py
> > @@ -440,7 +440,7 @@ class unixforkingservice(object):
> >      def init(self):
> >          self._sock = socket.socket(socket.AF_UNIX)
> >          self._servicehandler.bindsocket(self._sock, self.address)
> > -        self._sock.listen(5)
> > +        self._sock.listen(socket.SOMAXCONN)
> >          o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
> >          self._oldsigchldhandler = o
> >          self._servicehandler.printbanner(self.address)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -440,7 +440,7 @@  class unixforkingservice(object):
     def init(self):
         self._sock = socket.socket(socket.AF_UNIX)
         self._servicehandler.bindsocket(self._sock, self.address)
-        self._sock.listen(5)
+        self._sock.listen(socket.SOMAXCONN)
         o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
         self._oldsigchldhandler = o
         self._servicehandler.printbanner(self.address)