Commit 52599384 authored by Ge Jun's avatar Ge Jun

set preferred_index of main_socket for pooled connections

parent ad05b23e
...@@ -1039,8 +1039,8 @@ void Controller::IssueRPC(int64_t start_realtime_us) { ...@@ -1039,8 +1039,8 @@ void Controller::IssueRPC(int64_t start_realtime_us) {
SetFailed(EINVAL, "Invalid connection_type=%d", (int)_connection_type); SetFailed(EINVAL, "Invalid connection_type=%d", (int)_connection_type);
return HandleSendFailed(); return HandleSendFailed();
} }
tmp_sock.reset();
if (rc) { if (rc) {
tmp_sock.reset();
SetFailed(rc, "Fail to get %s connection", SetFailed(rc, "Fail to get %s connection",
ConnectionTypeToString(_connection_type)); ConnectionTypeToString(_connection_type));
return HandleSendFailed(); return HandleSendFailed();
...@@ -1050,6 +1050,12 @@ void Controller::IssueRPC(int64_t start_realtime_us) { ...@@ -1050,6 +1050,12 @@ void Controller::IssueRPC(int64_t start_realtime_us) {
// w/o trying other protocols. This is a must for (many) protocols that // w/o trying other protocols. This is a must for (many) protocols that
// can't be distinguished from other protocols w/o ambiguity. // can't be distinguished from other protocols w/o ambiguity.
_current_call.sending_sock->set_preferred_index(_preferred_index); _current_call.sending_sock->set_preferred_index(_preferred_index);
// Set preferred_index of main_socket as well to make it easier to
// debug and observe from /connections.
if (tmp_sock->preferred_index() < 0) {
tmp_sock->set_preferred_index(_preferred_index);
}
tmp_sock.reset();
} }
if (_tos > 0) { if (_tos > 0) {
_current_call.sending_sock->set_type_of_service(_tos); _current_call.sending_sock->set_type_of_service(_tos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment