From 941a356fa77ffc2f41d5054a8e3f43b46523008e Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 6 Mar 2017 11:51:31 +0000 Subject: [PATCH] mds: reset heartbeat in export_remaining_imported_caps This loop can be very long. Fixes: http://tracker.ceph.com/issues/19118 Signed-off-by: John Spray (cherry picked from commit 85071f1509beba4a390730e6a3a4332484646d63) --- src/mds/MDCache.cc | 2 ++ src/mds/MDSRank.h | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index e33424afd56..26adfcf053e 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -5610,6 +5610,8 @@ void MDCache::export_remaining_imported_caps() mds->send_message_client_counted(stale, q->first); } } + + mds->heartbeat_reset(); } for (map >::iterator p = cap_reconnect_waiters.begin(); diff --git a/src/mds/MDSRank.h b/src/mds/MDSRank.h index 190592eabf5..6f5cf103095 100644 --- a/src/mds/MDSRank.h +++ b/src/mds/MDSRank.h @@ -226,7 +226,6 @@ class MDSRank { bool _dispatch(Message *m, bool new_msg); ceph::heartbeat_handle_d *hb; // Heartbeat for threads using mds_lock - void heartbeat_reset(); bool is_stale_message(Message *m) const; @@ -297,6 +296,12 @@ class MDSRank { void respawn(); // <<< + /** + * Call this periodically if inside a potentially long running piece + * of code while holding the mds_lock + */ + void heartbeat_reset(); + /** * Report state DAMAGED to the mon, and then pass on to respawn(). Call * this when an unrecoverable error is encountered while attempting -- 2.47.3