[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-22 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695904#comment-16695904
 ] 

ASF GitHub Bot commented on THRIFT-4668:


jeking3 closed pull request #1631: THRIFT-4668: make socket backlog 
configurable for python
URL: https://github.com/apache/thrift/pull/1631
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/py/src/transport/TSocket.py b/lib/py/src/transport/TSocket.py
index c91de9d701..a7d661703d 100644
--- a/lib/py/src/transport/TSocket.py
+++ b/lib/py/src/transport/TSocket.py
@@ -159,6 +159,15 @@ def __init__(self, host=None, port=9090, unix_socket=None, 
socket_family=socket.
 self._unix_socket = unix_socket
 self._socket_family = socket_family
 self.handle = None
+self._backlog = 128
+
+def setBacklog(self, backlog=None):
+if not self.handle:
+self._backlog = backlog
+else:
+# We cann't update backlog when it is already listening, since the
+# handle has been created.
+logger.warn('You have to set backlog before listen.')
 
 def listen(self):
 res0 = self._resolveAddr()
@@ -183,7 +192,7 @@ def listen(self):
 if hasattr(self.handle, 'settimeout'):
 self.handle.settimeout(None)
 self.handle.bind(res[4])
-self.handle.listen(128)
+self.handle.listen(self._backlog)
 
 def accept(self):
 client, addr = self.handle.accept()


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-22 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695903#comment-16695903
 ] 

ASF GitHub Bot commented on THRIFT-4668:


jeking3 commented on issue #1631: THRIFT-4668: make socket backlog configurable 
for python
URL: https://github.com/apache/thrift/pull/1631#issuecomment-441031649
 
 
   Build failure is the SBCL issue we know about.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695576#comment-16695576
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut edited a comment on issue #1631: THRIFT-4668: make socket backlog 
configurable for python
URL: https://github.com/apache/thrift/pull/1631#issuecomment-440920684
 
 
   The value of `socket.SOMAXCONN`  depends on different operate systems:
   - on Window 7, it is `2147483647`
   - on Centos or Debian, it is `128`, even I have set a different value to 
`/proc/sys/net/core/somaxconn`
   
   According to `Python-2.7.14/Modules/socketmodule.c`:
   ```c
4967  /* Maximum number of connections for "listen" */
4968: #ifdef  SOMAXCONN
4969: PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);
4970  #else
4971: PyModule_AddIntConstant(m, "SOMAXCONN", 5); /* Common value */
4972  #endif
   ```
   
   The value of `SOMAXCONN` depend on system macro `SOMAXCONN`:
   - on Window 7, I can not explain why it is 2147483647
   - on linux, `SOMAXCONN` is defined in '/usr/include/bits/socket.h +144', 
hard code to 128
   
   Linux set  `SOMAXCONN` macro to` core.sysctl_somaxconn` first, then check 
the sysctl value of 'net.core.somaxconn' existing or not and override it if 
possible.
   
   When socket listening, if `backlog` is greater than SOMAXCONN, the kernel 
will take the value of `min(backlog, SOMAXCONN)`. Here is linux kernel code 
below:
   ```c
   // From linux-3.10.0-693.25.4.el7/net/socket.c +1534
   /*
*  Perform a listen. Basically, we allow the protocol to do anything
*  necessary for a listen, and if that works, we mark the socket as
*  ready for listening.
*/
   
   SYSCALL_DEFINE2(listen, int, fd, int, backlog)
   {
   struct socket *sock;
   int err, fput_needed;
   int somaxconn;
   
   sock = sockfd_lookup_light(fd, , _needed);
   if (sock) {
   somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn;
   if ((unsigned int)backlog > somaxconn)
   backlog = somaxconn;
   
   err = security_socket_listen(sock, backlog);
   if (!err)
   err = sock->ops->listen(sock, backlog);
   
   fput_light(sock->file, fput_needed);
   }
   return err;
   }
   ```
   
   Therefore, limit  `_backlog` to `socket.SOMAXCONN` will make 
`core.net.somaxconn` not working properly on linux.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695577#comment-16695577
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut edited a comment on issue #1631: THRIFT-4668: make socket backlog 
configurable for python
URL: https://github.com/apache/thrift/pull/1631#issuecomment-440920684
 
 
   The value of `socket.SOMAXCONN`  depends on different operate systems:
   - on Window 7, it is `2147483647`
   - on Centos or Debian, it is `128`, even I have set a different value to 
`/proc/sys/net/core/somaxconn`
   
   According to `Python-2.7.14/Modules/socketmodule.c`:
   ```c
4967  /* Maximum number of connections for "listen" */
4968: #ifdef  SOMAXCONN
4969: PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);
4970  #else
4971: PyModule_AddIntConstant(m, "SOMAXCONN", 5); /* Common value */
4972  #endif
   ```
   
   The value of `SOMAXCONN` depend on system macro `SOMAXCONN`:
   - on Window 7, I can not explain why it is 2147483647
   - on linux, `SOMAXCONN` is defined in '/usr/include/bits/socket.h +144', 
hard code to 128
   
   Linux set  `SOMAXCONN` macro to` core.sysctl_somaxconn` first, then check 
the sysctl value of 'net.core.somaxconn' existing or not and override it if 
possible.
   
   When socket listening, if `backlog` is greater than SOMAXCONN, the kernel 
will take the value of `min(backlog, SOMAXCONN)`. Here is linux kernel code 
below:
   ```c
   // From linux-3.10.0-693.25.4.el7/net/socket.c +1534
   /*
*  Perform a listen. Basically, we allow the protocol to do anything
*  necessary for a listen, and if that works, we mark the socket as
*  ready for listening.
*/
   
   SYSCALL_DEFINE2(listen, int, fd, int, backlog)
   {
   struct socket *sock;
   int err, fput_needed;
   int somaxconn;
   
   sock = sockfd_lookup_light(fd, , _needed);
   if (sock) {
   somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn;
   if ((unsigned int)backlog > somaxconn)
   backlog = somaxconn;
   
   err = security_socket_listen(sock, backlog);
   if (!err)
   err = sock->ops->listen(sock, backlog);
   
   fput_light(sock->file, fput_needed);
   }
   return err;
   }
   ```
   
   So limit  `_backlog` to `socket.SOMAXCONN` will make `core.net.somaxconn` 
not working properly on linux.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695573#comment-16695573
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut commented on issue #1631: THRIFT-4668: make socket backlog configurable 
for python
URL: https://github.com/apache/thrift/pull/1631#issuecomment-440920684
 
 
   The value of `socket.SOMAXCONN`  depends on different operate systems:
   - on Window 7, it is `2147483647`
   - on Centos or Debian, it is `128`, even I have set a different value to 
`/proc/sys/net/core/somaxconn`
   
   According to `Python-2.7.14/Modules/socketmodule.c`:
   ```c
4967  /* Maximum number of connections for "listen" */
4968: #ifdef  SOMAXCONN
4969: PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);
4970  #else
4971: PyModule_AddIntConstant(m, "SOMAXCONN", 5); /* Common value */
4972  #endif
   ```
   
   The value of `SOMAXCONN` depend on system macro `SOMAXCONN`:
   - on Window 7, I can not explain why it is 2147483647
   - on linux, `SOMAXCONN` is defined in '/usr/include/bits/socket.h +144', 
hard code to 128
   
   Linux set  `SOMAXCONN` macro to` core.sysctl_somaxconn` first, then check 
the sysctl value of 'net.core.somaxconn' existing or not and override it if 
possible.
   
   When socket listening, if `backlog` is greater than SOMAXCONN, the kernel 
will take the value of `min(backlog, SOMAXCONN)`. Here is linux kernel code 
below:
   ```c
   // From linux-3.10.0-693.25.4.el7/net/socket.c +1534
   /*
*  Perform a listen. Basically, we allow the protocol to do anything
*  necessary for a listen, and if that works, we mark the socket as
*  ready for listening.
*/
   
   SYSCALL_DEFINE2(listen, int, fd, int, backlog)
   {
   struct socket *sock;
   int err, fput_needed;
   int somaxconn;
   
   sock = sockfd_lookup_light(fd, , _needed);
   if (sock) {
   somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn;
   if ((unsigned int)backlog > somaxconn)
   backlog = somaxconn;
   
   err = security_socket_listen(sock, backlog);
   if (!err)
   err = sock->ops->listen(sock, backlog);
   
   fput_light(sock->file, fput_needed);
   }
   return err;
   }
   ```
   
   So doesn't it need to check the value of `_backlog` or not? May be a warning 
better?
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695534#comment-16695534
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235592274
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -183,7 +187,7 @@ def listen(self):
 if hasattr(self.handle, 'settimeout'):
 self.handle.settimeout(None)
 self.handle.bind(res[4])
-self.handle.listen(128)
+self.handle.listen(self._backlog)
 
 Review comment:
   We shoud not use `self.handle.listen(self._backlog or 128)` to preserve the 
existing behavior, because the backlog parameter accept a zero value.
   Plz have a look at the python source code below:
   ```c
   // From Python-2.7.14/Modules/socketmodule.c
   /* s.listen(n) method */
   
   static PyObject *
   sock_listen(PySocketSockObject *s, PyObject *arg)
   {
   // some code before
   /* To avoid problems on systems that don't allow a negative backlog
* (which doesn't make sense anyway) we force a minimum value of 0. */
   if (backlog < 0)
   backlog = 0;
   res = listen(s->sock_fd, backlog);
   // some code more
   }
   ```
   
   I have think about `self._backlog if self._backlog is None else 128 `, and 
the code seems to be redundant with bad smell. So declaring the _backlog 
attribute with a default value of 128 in the class constructor seems to be a 
better way, isn't? On the other hand, `__init__` will be called before listen, 
when the listen method calling, `this.handle.listen` will receive a `_backlog` 
with a default value of 128,  existing behavior preserved!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695533#comment-16695533
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235596635
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -159,6 +159,10 @@ def __init__(self, host=None, port=9090, 
unix_socket=None, socket_family=socket.
 self._unix_socket = unix_socket
 self._socket_family = socket_family
 self.handle = None
+self._backlog = 128
+
+def setBacklog(self, backlog):
 
 Review comment:
   Yeah, nothing works except `_backlog` changed. I should add some warning for 
it. Thank for your suggestions!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695519#comment-16695519
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235592434
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -159,6 +159,10 @@ def __init__(self, host=None, port=9090, 
unix_socket=None, socket_family=socket.
 self._unix_socket = unix_socket
 self._socket_family = socket_family
 self.handle = None
+self._backlog = 128
 
 Review comment:
   Please look at the comment below :)
   https://github.com/apache/thrift/pull/1631#discussion_r235592274


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695516#comment-16695516
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235592274
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -183,7 +187,7 @@ def listen(self):
 if hasattr(self.handle, 'settimeout'):
 self.handle.settimeout(None)
 self.handle.bind(res[4])
-self.handle.listen(128)
+self.handle.listen(self._backlog)
 
 Review comment:
   We shoud not use `self.handle.listen(self._backlog or 128)` to preserve the 
existing behavior, because the backlog parameter accept a zero value.
   Plz have a look at the python source code below:
   ```c
   // From Python-2.7.14/Modules/socketmodule.c
   /* s.listen(n) method */
   
   static PyObject *
   sock_listen(PySocketSockObject *s, PyObject *arg)
   {
   // some code before
   /* To avoid problems on systems that don't allow a negative backlog
* (which doesn't make sense anyway) we force a minimum value of 0. */
   if (backlog < 0)
   backlog = 0;
   res = listen(s->sock_fd, backlog);
   // some code more
   }
   ```
   
   I have think about `self._backlog if self._backlog is None else 128 `, and 
the code seems to be redundant with bad smell. So declaring the _backlog 
attribute with a default value of 128 in the class constructor seems to be a 
better way, isn't? On the other hand, `__init__` will be called before listen, 
while the listen method called, `this.handle.listen` will receive a `_backlog` 
with a default value of 128,  existing behavior preserved!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16694926#comment-16694926
 ] 

ASF GitHub Bot commented on THRIFT-4668:


jeking3 commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235463022
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -183,7 +187,7 @@ def listen(self):
 if hasattr(self.handle, 'settimeout'):
 self.handle.settimeout(None)
 self.handle.bind(res[4])
-self.handle.listen(128)
+self.handle.listen(self._backlog)
 
 Review comment:
   To preserve the existing behavior, how about 
`self.handle.listen(self._backlog or 128)`, in combination with a default value 
of None in the class constructor, this eliminates the need for setBacklog().


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16694927#comment-16694927
 ] 

ASF GitHub Bot commented on THRIFT-4668:


jeking3 commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235462834
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -159,6 +159,10 @@ def __init__(self, host=None, port=9090, 
unix_socket=None, socket_family=socket.
 self._unix_socket = unix_socket
 self._socket_family = socket_family
 self.handle = None
+self._backlog = 128
 
 Review comment:
   Should backlog be a named parameter with a default of None?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16694925#comment-16694925
 ] 

ASF GitHub Bot commented on THRIFT-4668:


jeking3 commented on a change in pull request #1631: THRIFT-4668: make socket 
backlog configurable for python
URL: https://github.com/apache/thrift/pull/1631#discussion_r235465457
 
 

 ##
 File path: lib/py/src/transport/TSocket.py
 ##
 @@ -159,6 +159,10 @@ def __init__(self, host=None, port=9090, 
unix_socket=None, socket_family=socket.
 self._unix_socket = unix_socket
 self._socket_family = socket_family
 self.handle = None
+self._backlog = 128
+
+def setBacklog(self, backlog):
 
 Review comment:
   What happens when you call this when it is already listening?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16694118#comment-16694118
 ] 

ASF GitHub Bot commented on THRIFT-4668:


lshgdut opened a new pull request #1631: THRIFT-4668: make socket backlog 
configurable
URL: https://github.com/apache/thrift/pull/1631
 
 
   The backlog parameter of socket.listen was hard coded, so I can't customize 
it in my code.
   
   Adding `setBacklog`  to `TServerSocket` can resolve my problem.  :)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable for python

2018-11-20 Thread lsh (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16694124#comment-16694124
 ] 

lsh commented on THRIFT-4668:
-

I have submitted the pull request, thanks for reviewing :) [~jking3] 

> make socket backlog configurable for python
> ---
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding `setBacklog` to `TServerSocket` can resolve my problem. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4668) make socket backlog configurable in python

2018-11-20 Thread James E. King III (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693237#comment-16693237
 ] 

James E. King III commented on THRIFT-4668:
---

If you have a pull request for this, please submit it.

> make socket backlog configurable in python
> --
>
> Key: THRIFT-4668
> URL: https://issues.apache.org/jira/browse/THRIFT-4668
> Project: Thrift
>  Issue Type: Improvement
>  Components: Python - Library
>Affects Versions: 0.11.0
>Reporter: lsh
>Priority: Minor
>  Labels: patch
>
> The backlog parameter of socket.listen was hard coded, so I can't customize 
> it in my code.
> Adding backlog parameter with a default value of 128 to constructor arguments 
> list can resolve my problem. :):)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)