]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: keep _has_next_outgoing calling under write_lock 15324/head
authorHaomai Wang <haomai@xsky.com>
Sat, 27 May 2017 02:44:34 +0000 (10:44 +0800)
committerHaomai Wang <haomai@xsky.com>
Sat, 27 May 2017 02:44:34 +0000 (10:44 +0800)
Signed-off-by: Haomai Wang <haomai@xsky.com>
src/msg/async/AsyncConnection.cc

index 7cc6fe97154278ee15cc0c99dc58174826dc3c36..1f6ffcea88a121eca4d24bce0ec5800b30f8f876 100644 (file)
@@ -2433,6 +2433,7 @@ void AsyncConnection::handle_write()
     }
 
     auto start = ceph::mono_clock::now();
+    bool more;
     do {
       bufferlist data;
       Message *m = _get_next_outgoing(&data);
@@ -2444,13 +2445,14 @@ void AsyncConnection::handle_write()
         sent.push_back(m);
         m->get();
       }
+      more = _has_next_outgoing();
       write_lock.unlock();
 
       // send_message or requeue messages may not encode message
       if (!data.length())
         prepare_send_message(get_features(), m, data);
 
-      r = write_message(m, data, _has_next_outgoing());
+      r = write_message(m, data, more);
       if (r < 0) {
         ldout(async_msgr->cct, 1) << __func__ << " send msg failed" << dendl;
         goto fail;