Skip to content

Commit

Permalink
[orchdaemon]: Fixed sairedis record file rotation
Browse files Browse the repository at this point in the history
What I did
Fix sonic-net/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
  • Loading branch information
bacrossland committed Oct 4, 2022
1 parent caa0fb9 commit e16da84
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/mock_tests/orchdaemon_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);

};

Expand Down

0 comments on commit e16da84

Please sign in to comment.