]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async/ProtocolV2: call KeepAliveFrameAck::Encode() without `write_lock`
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 7 Oct 2024 17:13:41 +0000 (19:13 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Mon, 7 Oct 2024 21:22:12 +0000 (23:22 +0200)
Reduce lock time/contention.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/msg/async/ProtocolV2.cc

index 0ca8afcad25b2ff4b29db6ad258e819d4dd4b6ee..1ac4c1ae3116f491feeff44b09ee53a9dc6228be 100644 (file)
@@ -1653,8 +1653,8 @@ CtPtr ProtocolV2::handle_keepalive2(ceph::bufferlist &payload)
 
   ldout(cct, 30) << __func__ << " got KEEPALIVE2 tag ..." << dendl;
 
-  connection->write_lock.lock();
   auto keepalive_ack_frame = KeepAliveFrameAck::Encode(keepalive_frame.timestamp());
+  connection->write_lock.lock();
   if (!append_frame(keepalive_ack_frame)) {
     connection->write_lock.unlock();
     return _fault();