Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1497#discussion_r172695014
  
    --- Diff: lib/cpp/src/thrift/server/TNonblockingServer.cpp ---
    @@ -472,6 +472,18 @@ void TNonblockingServer::TConnection::workSocket() {
         }
         // size known; now get the rest of the frame
         transition();
    +
    +    // If the socket has more data than the frame header, continue to work 
on it. This is not strictly necessary for
    +    // regular sockets, because if there is more data, libevent will fire 
the event handler registered for read
    +    // readiness, which will in turn call workSocket(). However, some 
socket types (such as TSSLSocket) may have the
    +    // data sitting in their internal buffers and from libevent's 
perspective, there is no further data available. In
    +    // that case, not having this workSocket() call here would result in a 
hang as we will never get to work the socket,
    +    // despite having more data.
    +    if (tSocket_->hasPendingDataToRead())
    --- End diff --
    
    I am concerned this can cause an infinite loop if data is always available, 
since it calls itself.


---

Reply via email to