Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3449,6 +3449,11 @@ int syncd_main(int argc, char **argv)

#endif

FlexCounter::removeAllCounters();

// Stop notification thread before removing switch
stopNotificationsProcessingThread();

status = sai_switch_api->remove_switch(gSwitchId);
if (status != SAI_STATUS_SUCCESS)
{
Expand All @@ -3465,8 +3470,6 @@ int syncd_main(int argc, char **argv)
SWSS_LOG_ERROR("failed to uninitialize api: %s", sai_serialize_status(status).c_str());
}

stopNotificationsProcessingThread();

SWSS_LOG_NOTICE("uninitialize finished");

return EXIT_SUCCESS;
Expand Down
7 changes: 7 additions & 0 deletions syncd/syncd_flex_counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ void FlexCounter::removeCounterPlugin(
}
}

void FlexCounter::removeAllCounters()
{
SWSS_LOG_ENTER();

g_flex_counters_map.clear();
}


FlexCounter::~FlexCounter(void)
{
Expand Down
1 change: 1 addition & 0 deletions syncd/syncd_flex_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class FlexCounter
_In_ std::string instanceId);
static void removeCounterPlugin(
_In_ std::string instanceId);
static void removeAllCounters();

FlexCounter(
_In_ const FlexCounter&) = delete;
Expand Down
2 changes: 0 additions & 2 deletions syncd/syncd_notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,6 @@ void startNotificationsProcessingThread()
runThread = true;

ntf_process_thread = std::make_shared<std::thread>(ntf_process_function);

ntf_process_thread->detach();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea this was causing issue

}

void stopNotificationsProcessingThread()
Expand Down