thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bgedik <>
Subject [GitHub] thrift pull request #1497: Do not call workSocket() in TNonblockigServer wit...
Date Wed, 07 Mar 2018 06:54:33 GMT
Github user bgedik commented on a diff in the pull request:
    --- 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
    +    // 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 --
    It can't. Note that the line above is ``transition()``. So the next time we call ``workSocket()``
it is a different state. 
    Btw, I assume you notice that the original ``workSocket`` call I removed, which was causing
the superfluous exception, was inside ``workSocket`` as well.


View raw message