From: Haomai Wang Date: Mon, 27 Jul 2015 04:34:18 +0000 (+0800) Subject: AsyncConnection: Exit process loop if entering fault X-Git-Tag: v9.1.0~483^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3482e689eebf84a7c2c3ffdad791b126845d702c;p=ceph.git AsyncConnection: Exit process loop if entering fault "fault" will transmit state to exception state or STATE_CONNECTING, all transmitted states don't need to check right now. Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 2cec7fde0903b..d437eb45f5e57 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -897,40 +897,40 @@ void AsyncConnection::process() break; } } + } while (prev_state != state); - continue; - -fail: - // clean up state internal variables and states - if (state >= STATE_CONNECTING_SEND_CONNECT_MSG && - state <= STATE_CONNECTING_READY) { - delete authorizer; - authorizer = NULL; - got_bad_auth = false; - } + return; - if (state > STATE_OPEN_MESSAGE_THROTTLE_MESSAGE && - state <= STATE_OPEN_MESSAGE_READ_FOOTER_AND_DISPATCH - && policy.throttler_messages) { - ldout(async_msgr->cct,10) << __func__ << " releasing " << 1 - << " message to policy throttler " - << policy.throttler_messages->get_current() << "/" - << policy.throttler_messages->get_max() << dendl; - policy.throttler_messages->put(); - } - if (state > STATE_OPEN_MESSAGE_THROTTLE_BYTES && - state <= STATE_OPEN_MESSAGE_READ_FOOTER_AND_DISPATCH) { - uint64_t message_size = current_header.front_len + current_header.middle_len + current_header.data_len; - if (policy.throttler_bytes) { - ldout(async_msgr->cct,10) << __func__ << " releasing " << message_size - << " bytes to policy throttler " - << policy.throttler_bytes->get_current() << "/" - << policy.throttler_bytes->get_max() << dendl; - policy.throttler_bytes->put(message_size); - } + fail: + // clean up state internal variables and states + if (state >= STATE_CONNECTING_SEND_CONNECT_MSG && + state <= STATE_CONNECTING_READY) { + delete authorizer; + authorizer = NULL; + got_bad_auth = false; + } + + if (state > STATE_OPEN_MESSAGE_THROTTLE_MESSAGE && + state <= STATE_OPEN_MESSAGE_READ_FOOTER_AND_DISPATCH + && policy.throttler_messages) { + ldout(async_msgr->cct,10) << __func__ << " releasing " << 1 + << " message to policy throttler " + << policy.throttler_messages->get_current() << "/" + << policy.throttler_messages->get_max() << dendl; + policy.throttler_messages->put(); + } + if (state > STATE_OPEN_MESSAGE_THROTTLE_BYTES && + state <= STATE_OPEN_MESSAGE_READ_FOOTER_AND_DISPATCH) { + uint64_t message_size = current_header.front_len + current_header.middle_len + current_header.data_len; + if (policy.throttler_bytes) { + ldout(async_msgr->cct,10) << __func__ << " releasing " << message_size + << " bytes to policy throttler " + << policy.throttler_bytes->get_current() << "/" + << policy.throttler_bytes->get_max() << dendl; + policy.throttler_bytes->put(message_size); } - fault(); - } while (prev_state != state); + } + fault(); } int AsyncConnection::_process_connection()