[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-4670) Twisted, slots, and void method fails with "object has no attribute 'success'"

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


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

ASF GitHub Bot commented on THRIFT-4670:


DaGenix opened a new pull request #1632: THRIFT-4670: Twisted, slots, and void 
method fails with "object has no attribute 'success'"
URL: https://github.com/apache/thrift/pull/1632
 
 
   For a void method, there is no success value, so, it is an error to
   attempt to assign one to the result object. This error is harmless
   unless slots is also specified - with slots specified, the attempt to
   assign to a non-existent field causes an error which makes the service
   method fail.
   
   Client: py


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


> Twisted, slots, and void method fails with "object has no attribute 'success'"
> --
>
> Key: THRIFT-4670
> URL: https://issues.apache.org/jira/browse/THRIFT-4670
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler
>Affects Versions: 0.9.3, 0.10.0, 0.11.0
>Reporter: Palmer
>Priority: Minor
>
> When generating Twisted code for a void method, the compiler accidentally 
> assigns a value to the result.success field of the result object, even 
> though, as a void method, there is no success value and the result object has 
> no such field. If the slots option is not specified as well, this does not 
> cause a problem, it just sets a new field that is never used. However, with 
> the slots option, attempting to set this undefined field causes the error 
> "object has no attribute 'success'"



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


[jira] [Updated] (THRIFT-4670) Twisted, slots, and void method fails with "object has no attribute 'success'"

2018-11-21 Thread Palmer (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Palmer updated THRIFT-4670:
---
Patch Info: Patch Available

> Twisted, slots, and void method fails with "object has no attribute 'success'"
> --
>
> Key: THRIFT-4670
> URL: https://issues.apache.org/jira/browse/THRIFT-4670
> Project: Thrift
>  Issue Type: Bug
>  Components: Python - Compiler
>Affects Versions: 0.9.3, 0.10.0, 0.11.0
>Reporter: Palmer
>Priority: Minor
>
> When generating Twisted code for a void method, the compiler accidentally 
> assigns a value to the result.success field of the result object, even 
> though, as a void method, there is no success value and the result object has 
> no such field. If the slots option is not specified as well, this does not 
> cause a problem, it just sets a new field that is never used. However, with 
> the slots option, attempting to set this undefined field causes the error 
> "object has no attribute 'success'"



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


[jira] [Created] (THRIFT-4670) Twisted, slots, and void method fails with "object has no attribute 'success'"

2018-11-21 Thread Palmer (JIRA)
Palmer created THRIFT-4670:
--

 Summary: Twisted, slots, and void method fails with "object has no 
attribute 'success'"
 Key: THRIFT-4670
 URL: https://issues.apache.org/jira/browse/THRIFT-4670
 Project: Thrift
  Issue Type: Bug
  Components: Python - Compiler
Affects Versions: 0.11.0, 0.10.0, 0.9.3
Reporter: Palmer


When generating Twisted code for a void method, the compiler accidentally 
assigns a value to the result.success field of the result object, even though, 
as a void method, there is no success value and the result object has no such 
field. If the slots option is not specified as well, this does not cause a 
problem, it just sets a new field that is never used. However, with the slots 
option, attempting to set this undefined field causes the error "object has no 
attribute 'success'"



--
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] [Created] (THRIFT-4669) The wifi disconnection does not raise an event close or error on a tablet DURABOOK R11AH

2018-11-21 Thread otraore (JIRA)
otraore created THRIFT-4669:
---

 Summary: The wifi disconnection does not raise an event close or 
error on a tablet DURABOOK R11AH
 Key: THRIFT-4669
 URL: https://issues.apache.org/jira/browse/THRIFT-4669
 Project: Thrift
  Issue Type: Question
  Components: Node.js - Library
Affects Versions: 0.10.0
 Environment: Operating system : Windows 10

Processor : 64 bits

Model : DURABOOK R11AH

Client thrift librarie : Node.js

Server thrift librarie : C++

Socket option : Default (Transport, Protocol)
Reporter: otraore


When we connect the DURABOOK tablet in wifi on our server through Thrift.

The thrift client {color:#d04437}{color:#33}(the{color}{color} DURABOOK 
tablet) does not raise the *{color:#FF}close{color}* or 
{color:#FF}*error* {color:#33}event{color}{color} when we disconnect 
the wifi.

The event is only raised when we change the wifi network.

NB : The event is well done on a computer like DELL, with the same operating 
system(Windows 10).

My question is : Do you think that you need to put specific options for 
creating the connection for the socket? or is it a hardware problem.

 

Thank you beforehand



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