Skip to content

[orchdaemon]: Fixed sairedis record file rotation#2480

Merged
yxieca merged 3 commits intosonic-net:202205from
target:202205-logrotate
Oct 4, 2022
Merged

[orchdaemon]: Fixed sairedis record file rotation#2480
yxieca merged 3 commits intosonic-net:202205from
target:202205-logrotate

Conversation

@bacrossland
Copy link
Copy Markdown
Contributor

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 [email protected]

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 [email protected]
@bacrossland bacrossland requested a review from prsunny as a code owner October 4, 2022 03:54
@bacrossland
Copy link
Copy Markdown
Contributor Author

@yxieca This is the PR for back porting #2299 to 202205

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 [email protected]
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 [email protected]
@prsunny prsunny requested a review from kcudnik October 4, 2022 15:21
@yxieca yxieca merged commit 6b6d25d into sonic-net:202205 Oct 4, 2022
@yxieca
Copy link
Copy Markdown
Contributor

yxieca commented Oct 4, 2022

@bacrossland much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants