| 330 | /// This is safe if and only if DoRpc() returned RPC_RECV_TIMEOUT. |
| 331 | template <class F, class Response> |
| 332 | Status RetryRpcRecv(const F& recv_func, Response* response) { |
| 333 | DCHECK(response != NULL); |
| 334 | DCHECK(client_is_unrecoverable_); |
| 335 | try { |
| 336 | (client_->*recv_func)(*response); |
| 337 | } catch (const apache::thrift::transport::TTransportException& e) { |
| 338 | if (IsReadTimeoutTException(e)) { |
| 339 | return RecvTimeoutStatus(typeid(*response).name()); |
| 340 | } |
| 341 | // If it's not timeout exception, then the connection is broken, stop retrying. |
| 342 | return GeneralErrorStatus(e, typeid(*response).name(), true); |
| 343 | } catch (const apache::thrift::TException& e) { |
| 344 | return GeneralErrorStatus(e, typeid(*response).name(), true); |
| 345 | } |
| 346 | client_is_unrecoverable_ = false; |
| 347 | return Status::OK(); |
| 348 | } |
| 349 | |
| 350 | private: |
| 351 | ClientCache<T>* client_cache_; |
nothing calls this directly
no test coverage detected