From f9a97b08896e5ae969ecf2d8257ef918d7b0db1c Mon Sep 17 00:00:00 2001 From: Jerry Johns Date: Fri, 8 Jul 2022 15:11:38 -0700 Subject: [PATCH] Fix SessionManager::Shutdown to actually shut-down sessions (#20487) SessionManager::Shutdown() wasn't actually shutting down any sessions that were resident in the session table. This meant that they would only get torn down on program termination, which causes issues in the Python REPL since it results in Log prints being emitted well after we've actually disconnected the logging subsystem. --- src/transport/SessionManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 3a7bd44a3ce38f..bd84ab651ba84d 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -111,6 +111,12 @@ void SessionManager::Shutdown() mFabricTable->RemoveFabricDelegate(this); mFabricTable = nullptr; } + + mSecureSessions.ForEachSession([&](auto session) { + session->MarkForEviction(); + return Loop::Continue; + }); + mMessageCounterManager = nullptr; mState = State::kNotReady;