Github user nsuke commented on the pull request:
https://github.com/apache/thrift/pull/945#issuecomment-197491268
As further looking into your use case (happybase), I doubt it's what you
wanted.
happybase does not seem to bother with transport state at all; by `isOpen`
it only avoids "already opened" exceptions.
I'm all for reducing reinvented wheels in users' codebase if users are
repeatedly implementing the same thing, but in this case, are there really
those wheels ?
Note that almighty "this connection is fine" guarantee is very costly: even
the current patch does not cover cases like invalidated file descriptor (i.e.
closed socket) and half closed non-writable sockets.
Another crucial point to note is that even after a perfect guarantee,
nothing is guaranteed a moment later, because we cannot share a lock/mutex with
remote server, let alone with physical network.
So you still need the exact same TTranisportException error handling, and
the most efficient way would probably be to try doing normal procedures anyway,
catch exceptions and start over if errored.
I understand it looks stupid but I'd like to remind you of the word "keep
it simple stupid".
---
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 [email protected] or file a JIRA ticket
with INFRA.
---