From e16da84fd25b41744307c204b324c24c0434cb09 Mon Sep 17 00:00:00 2001 From: Bryan Crossland Date: Tue, 4 Oct 2022 14:56:39 -0500 Subject: [PATCH] [orchdaemon]: Fixed sairedis record file rotation What I did Fix Azure/sonic-buildimage#8162 Moved sairedis record file rotation logic out of flush() to fix issue. Why I did it Sairedis record file was not releasing the file handle on rotation. This is because the file handle release was inside the flush() which was only being called if a select timeout was triggered. Moved the logic to its own function which is called in the start() loop. How I verified it Ran a script to fill log and verified that rotation was happening correctly. Signed-off-by: Bryan Crossland bryan.crossland@target.com --- tests/mock_tests/orchdaemon_ut.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/mock_tests/orchdaemon_ut.cpp b/tests/mock_tests/orchdaemon_ut.cpp index cf51476a7c..381518ea59 100644 --- a/tests/mock_tests/orchdaemon_ut.cpp +++ b/tests/mock_tests/orchdaemon_ut.cpp @@ -17,7 +17,6 @@ namespace orchdaemon_test DBConnector appl_db("APPL_DB", 0); DBConnector state_db("STATE_DB", 0); DBConnector config_db("CONFIG_DB", 0); - DBConnector counters_db("COUNTERS_DB", 0); class OrchDaemonTest : public ::testing::Test { @@ -33,7 +32,7 @@ namespace orchdaemon_test sai_switch_api->get_switch_attribute = &mock_get_switch_attribute; sai_switch_api->set_switch_attribute = &mock_set_switch_attribute; - orchd = new OrchDaemon(&appl_db, &config_db, &state_db, &counters_db); + orchd = new OrchDaemon(&appl_db, &config_db, &state_db); };