thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiaosuo <...@git.apache.org>
Subject [GitHub] thrift issue #422: THRIFT-3080: fix connection leak of C++ Nonblocking Serve...
Date Fri, 24 Feb 2017 06:56:44 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message