MCPcopy Create free account
hub / github.com/apache/impala / OpenWithRetry

Method OpenWithRetry

be/src/rpc/thrift-client.cc:88–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88Status ThriftClientImpl::OpenWithRetry(uint32_t num_tries, uint64_t wait_ms) {
89 // Socket creation failures are not recoverable.
90 RETURN_IF_ERROR(init_status_);
91
92 uint32_t try_count = 0L;
93 while (true) {
94 ++try_count;
95 Status status = Open();
96 if (status.ok()) return status;
97
98 LOG(INFO) << "Unable to connect to " << TNetworkAddressToString(address_);
99 if (num_tries == 0) {
100 LOG(INFO) << "(Attempt " << try_count << ", will retry indefinitely)";
101 } else {
102 if (num_tries != 1) {
103 // No point logging 'attempt 1 of 1'
104 LOG(INFO) << "(Attempt " << try_count << " of " << num_tries << ")";
105 }
106 if (try_count == num_tries) return status;
107 }
108 SleepForMs(wait_ms);
109 }
110}
111
112void ThriftClientImpl::Close() {
113 try {

Callers 1

CreateClientMethod · 0.80

Calls 2

TNetworkAddressToStringFunction · 0.85
okMethod · 0.45

Tested by

no test coverage detected