diff --git a/library/cpp/sandesh_state_machine.cc b/library/cpp/sandesh_state_machine.cc index a619b21c..a618d18b 100644 --- a/library/cpp/sandesh_state_machine.cc +++ b/library/cpp/sandesh_state_machine.cc @@ -781,9 +781,10 @@ void SandeshStateMachine::SetSandeshMessageDropLevel(size_t queue_count, Sandesh::LevelToString(level) << "], SM QUEUE COUNT: " << queue_count); message_drop_level_ = level; - if (!cb.empty()) { - cb(); - } + } + // Always invoke the callback + if (!cb.empty()) { + cb(); } }