thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Buğra Gedik (JIRA) <>
Subject [jira] [Commented] (THRIFT-4465) TNonblockingServer throwing THRIFT LOGGER: TConnection::workSocket(): THRIFT_EAGAIN (unavailable resources)
Date Sun, 21 Jan 2018 19:07:00 GMT


Buğra Gedik commented on THRIFT-4465:

[~jking3]: While removing the {{workSocket()}} fixes the problem for the regular sockets,
it breaks SSL based sockets. It turns out the SSL sockets circumvent the spurious exceptions
via the following code.


 } catch (TTransportException& te) {
      //In Nonblocking SSLSocket some operations need to be retried again.
      //Current approach is parsing exception message, but a better solution needs to
be investigated.
      if(!strstr(te.what(), "retry")) {
        GlobalOutput.printf("TConnection::workSocket(): %s", te.what());


This looks wrong at so many levels if you ask me. Handling retries with an exception is a
performance killer. Then there is the issue of searching for a message string in the exception.
In any case, the original code before the SSL changes assumed that you only consume from a
socket once it is ready for reading, so you never get an exception. By uncommenting the early
workStatus() call, the SSL PR changed this and handled the resulting exception with the above
code, but only for the SSL setup, and not for regular sockets!!!

I'll see if I can figure out:

1) Why does SSL server depend on the premature workStatus() call.

2) Can the SSL server be changed to work without having to perform retries with an exception.



> TNonblockingServer throwing THRIFT LOGGER: TConnection::workSocket(): THRIFT_EAGAIN (unavailable
> -----------------------------------------------------------------------------------------------------------
>                 Key: THRIFT-4465
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.11.0
>            Reporter: Buğra Gedik
>            Priority: Critical
> Once I upgraded to 0.11.0, I'm getting the following error occasionally:
> THRIFT LOGGER: TConnection::workSocket(): THRIFT_EAGAIN (unavailable resources)
> I tracked this to the following change: []
> {code:java}
> // Work the socket right away
> - // workSocket();
> + workSocket();
> {code}
> While adding SSL support, @dthaluru has re-activated the above line. From my own testing,
this causes occasional THRIFT_EAGAIN exceptions. It seems like this is due to calling workSocket()
too early and the socket gets a read call in non-blocking mode before it has data.

This message was sent by Atlassian JIRA

View raw message