From 75b2d88ca00c85889f51114c124747207ddaf459 Mon Sep 17 00:00:00 2001 From: Megh Bhatt Date: Mon, 21 Dec 2015 15:25:53 -0800 Subject: [PATCH] Fix contrail-collector back pressure mechanism contrail-collector SM queue back presssure mechanism was not working since the SM drop level is initialized to INVALID and even the water marks levels are INVALID and hence the defer/undefer callbacks are not called. Change-Id: Ieaf65d3d77356b9ac471e9479a1fb743c16fe6a1 Closes-Bug: #1528380 (cherry picked from commit 68c2ef7d6b8e6adc36f6003e0bcb97bab310750d) --- library/cpp/sandesh_state_machine.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); } }