Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nautilus: msg/async, v2: make the reset_recv_state() unconditional #29140

Merged
merged 2 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion qa/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@
fun:_ZN10ProtocolV231handle_read_frame_epilogue_mainEOSt10unique_ptrIN4ceph6buffer7v14_2_08ptr_nodeENS4_8disposerEEi
fun:_ZN10ProtocolV216run_continuationER2CtIS_E
...
fun:_ZN15AsyncConnection7processEv
fun:_ZN11EventCenter14process_eventsEjPNSt6chrono8durationImSt5ratioILl1ELl1000000000EEEE
fun:operator()
fun:_ZNSt17_Function_handlerIFvvEZN12NetworkStack10add_threadEjEUlvE_E9_M_invokeERKSt9_Any_data
Expand Down
19 changes: 9 additions & 10 deletions src/msg/async/ProtocolV2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,11 @@ uint64_t ProtocolV2::discard_requeued_up_to(uint64_t out_seq, uint64_t seq) {
}

void ProtocolV2::reset_recv_state() {
if ((state >= AUTH_CONNECTING && state <= SESSION_RECONNECTING) ||
state == READY) {
auth_meta.reset(new AuthConnectionMeta);
session_stream_handlers.tx.reset(nullptr);
session_stream_handlers.rx.reset(nullptr);
pre_auth.txbuf.clear();
pre_auth.rxbuf.clear();
}
auth_meta.reset(new AuthConnectionMeta);
session_stream_handlers.tx.reset(nullptr);
session_stream_handlers.rx.reset(nullptr);
pre_auth.txbuf.clear();
pre_auth.rxbuf.clear();

// clean read and write callbacks
connection->pendingReadLen.reset();
Expand Down Expand Up @@ -2663,6 +2660,10 @@ CtPtr ProtocolV2::reuse_connection(AsyncConnectionRef existing,

ldout(messenger->cct, 5) << __func__ << " stop myself to swap existing"
<< dendl;

std::swap(exproto->session_stream_handlers, session_stream_handlers);
exproto->auth_meta = auth_meta;

// avoid _stop shutdown replacing socket
// queue a reset on the new connection, which we're dumping for the old
stop();
Expand All @@ -2672,8 +2673,6 @@ CtPtr ProtocolV2::reuse_connection(AsyncConnectionRef existing,
exproto->can_write = false;
exproto->reconnecting = reconnecting;
exproto->replacing = true;
std::swap(exproto->session_stream_handlers, session_stream_handlers);
exproto->auth_meta = auth_meta;
existing->state_offset = 0;
// avoid previous thread modify event
exproto->state = NONE;
Expand Down