-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys/chunked_ringbuffer: discard stale chunk when starting a new one #21073
sys/chunked_ringbuffer: discard stale chunk when starting a new one #21073
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that really expected behavior? An alternative would be to return an error upon adding a chunk while the previous has not been ended.
At least, the implemented behavior should be documented somewhere.
d2d46bb
to
3d16d4b
Compare
3d16d4b
to
50b7467
Compare
I updated the documentation. |
72d4d76
to
532f018
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me now!
Contribution description
If there is a non-finished chunk in the ringbuffer when a new one is started, discard the stale chunk first.
Testing procedure
The unit test is expanded to cover this case.
Issues/PRs references