Skip to content
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

Merged
merged 2 commits into from
Dec 14, 2024

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Dec 11, 2024

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

@github-actions github-actions bot added the Area: sys Area: System label Dec 11, 2024
@benpicco benpicco requested a review from miri64 as a code owner December 11, 2024 13:44
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Dec 11, 2024
@benpicco benpicco requested a review from jue89 December 11, 2024 13:45
@derMihai derMihai mentioned this pull request Dec 11, 2024
1 task
Copy link
Contributor

@mguetschow mguetschow left a 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.

@benpicco benpicco force-pushed the sys/chunked_ringbuffer-start_discard branch from d2d46bb to 3d16d4b Compare December 12, 2024 10:17
@benpicco benpicco force-pushed the sys/chunked_ringbuffer-start_discard branch from 3d16d4b to 50b7467 Compare December 12, 2024 10:18
@benpicco
Copy link
Contributor Author

I updated the documentation.

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 12, 2024
@riot-ci
Copy link

riot-ci commented Dec 12, 2024

Murdock results

✔️ PASSED

532f018 tests/unittests: chunked_ringbuffer: add test for half-written chunk

Success Failures Total Runtime
10248 0 10249 17m:51s

Artifacts

@benpicco benpicco force-pushed the sys/chunked_ringbuffer-start_discard branch from 72d4d76 to 532f018 Compare December 13, 2024 15:30
Copy link
Contributor

@mguetschow mguetschow left a 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!

@mguetschow mguetschow enabled auto-merge December 13, 2024 18:19
@mguetschow mguetschow added this pull request to the merge queue Dec 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 13, 2024
@maribu maribu added this pull request to the merge queue Dec 14, 2024
Merged via the queue into RIOT-OS:master with commit 4d44abc Dec 14, 2024
26 checks passed
@benpicco benpicco deleted the sys/chunked_ringbuffer-start_discard branch December 14, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants