Skip to content

Commit

Permalink
msg/async/AsyncConnection: avoid dup RETRYGLOBAL sending
Browse files Browse the repository at this point in the history
if two accept all going to dispatch RETRYGLOBAL sending, it will cause
invalid connect side receiver.

Signed-off-by: Haomai Wang <haomai@xsky.com>
  • Loading branch information
yuyuyu101 committed Jun 28, 2016
1 parent 6475d86 commit b9cc756
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/msg/async/AsyncConnection.cc
Expand Up @@ -1827,15 +1827,18 @@ ssize_t AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlis
_stop();
// queue a reset on the new connection, which we're dumping for the old
dispatch_queue->queue_reset(this);
existing->lock.Unlock();

center->submit_to(existing->center->get_id(), [existing, connect, reply, authorizer_reply]() mutable {
int new_fd = existing->sd;
center->submit_to(existing->center->get_id(), [existing, new_fd, connect, reply, authorizer_reply]() mutable {
Mutex::Locker l(existing->lock);
if (new_fd != existing->sd)
return ;

if (existing->_reply_accept(CEPH_MSGR_TAG_RETRY_GLOBAL, connect, reply, authorizer_reply) < 0) {
// handle error
existing->fault();
}
}, true);
existing->lock.Unlock();

return 0;
}
Expand Down

0 comments on commit b9cc756

Please sign in to comment.