Project

General

Profile

Bug #10944 » 0002-Change-cond-wait-to-cond_timeout-wait-in-Client-make.patch

Zheng Yan, 07/08/2015 09:43 AM

View differences:

src/client/Client.cc
request->kick = false;
while (!request->reply && // reply
request->resend_mds < 0 && // forward
!request->kick)
caller_cond.Wait(client_lock);
!request->kick) {
utime_t w;
w.set_from_double(cct->_conf->client_request_timeout);
int ret_status = caller_cond.WaitInterval(cct, client_lock, w);
if (ret_status == ETIMEDOUT && !request->reply) {
request->aborted = true;
break;
}
}
request->caller_cond = NULL;
// did we get a reply?
if (request->reply)
if (request->reply)
break;
}
......
}
}
// Only signal the caller once (on the first reply):
// Either its an unsafe reply, or its a safe reply and no unsafe reply was sent.
if (!is_safe || !request->got_unsafe) {
if (request->aborted) {
request->reply->put();
request->reply = NULL;
} else if (!is_safe || !request->got_unsafe) {
// Only signal the caller once (on the first reply):
// // Either its an unsafe reply, or its a safe reply and no unsafe reply was sent.
Cond cond;
request->dispatch_cond = &cond;
src/common/config_opts.h
OPTION(client_cache_size, OPT_INT, 16384)
OPTION(client_cache_mid, OPT_FLOAT, .75)
OPTION(client_use_random_mds, OPT_BOOL, false)
OPTION(client_request_timeout, OPT_DOUBLE, 120.0) // timeout for a single request to mds in seconds
OPTION(client_mount_timeout, OPT_DOUBLE, 300.0)
OPTION(client_tick_interval, OPT_DOUBLE, 1.0)
OPTION(client_trace, OPT_STR, "")
(3-3/3)