Client lib: Asd_client::partial_get uses huge timeout in partial read
Closed this issue · 0 comments
redlicha commented
void Asd_client::partial_get(string &key, vector<slice> &slices) {
_transport->expires_from_now(_timeout);
asd_protocol::write_partial_get_request(_mb, key, slices);
_transport->output(_mb);
_mb.reset();
message response = _transport->read_message();
bool success;
asd_protocol::read_partial_get_response(response, _status, success);
check_status(__PRETTY_FUNCTION__);
for (auto &slice : slices) {
_transport->read_exact((char *)slice.target, slice.length);
}
}
void Asd_client::check_status(const char *function_name) {
_transport->expires_from_now(std::chrono::steady_clock::duration::max());
if (not _status.is_ok()) {
ALBA_LOG(DEBUG, function_name << " received rc:"
<< (uint32_t)_status._return_code)
throw asd_exception(_status._return_code, function_name);
}
}
=> the transport->read_exact
calls in partial_get_request
have a timeout of Clock::max()
.