thrift-pool-client icon indicating copy to clipboard operation
thrift-pool-client copied to clipboard

ThriftConnectionPoolProvider.getConnection(ThriftServerInfo thriftServerInfo) should always throw exception

Open aronica opened this issue 7 years ago • 1 comments

/** {@inheritDoc} */ @Override public TTransport getConnection(ThriftServerInfo thriftServerInfo){ try { return connections.borrowObject(thriftServerInfo); } catch (Exception e) { logger.error("fail to get connection for {}", thriftServerInfo, e); throw new RuntimeException(e); } } Exception e in catch block is a checked exception and most likely to be TTransportException, we should rethrow it and dealing with it in ThriftClientImpl(remove TServerInfo with connection problem in ThriftConnectionPoolProvider and try to return valid connection from other TServerInfo),i will fork your code and try to fix as i wrote above.

aronica avatar Apr 19 '17 03:04 aronica

You're right. welcome to pr.

PhantomThief avatar Apr 24 '17 14:04 PhantomThief