[GitHub] thrift issue #422: THRIFT-3080: fix connection leak of C++ Nonblocking Serve...

2017-05-12 Thread lyhuzi
Github user lyhuzi commented on the issue:

https://github.com/apache/thrift/pull/422
  
why not use ul_swriteo_ms_ex2


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift issue #422: THRIFT-3080: fix connection leak of C++ Nonblocking Serve...

2017-05-12 Thread lyhuzi
Github user lyhuzi commented on the issue:

https://github.com/apache/thrift/pull/422
  
为什么不用ul_swriteo_ms_ex2


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] thrift issue #422: THRIFT-3080: fix connection leak of C++ Nonblocking Serve...

2017-02-23 Thread xiaosuo
Github user xiaosuo commented on the issue:

https://github.com/apache/thrift/pull/422
  
This patch may introduce a more serious problem in theory.

No standard defines writing to a socket is an atomic operation, so if 
writing is interleaved by other threads, the reading end will end up with an 
invalid connection pointer, and the following operation on connection will 
cause segment fault.

In order to fix the above issue, we must turn to pipe(2), which guarantees 
that writing data less than PIPE_BUF is atomic . And pipes are more efficient 
than sockets, because no skb is required to save small pointers.

BTW, if we don't set the writing end to nonblocking mode, we don't need to 
use select to emulate it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---