Repository navigation
zstd: apply reset options to reused frame decoders - #1226
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe decoder stores options in an atomic snapshot. Reset operations publish updated snapshots, and decoding paths apply options to active frame decoders. Tests cover reset behavior, concurrent decoding, limits, checksums, and dictionaries. ChangesDecoder option snapshots
Priority: ⚪ Not assessed Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No concrete decoder regression remains identified; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Great spot! Looks great! I'll give it a look through. |
ae4ebc1 to
5a25423
Compare
klauspost
left a comment
There was a problem hiding this comment.
Overall looks clean, but looked for some simplifications.
|
Nice! I will look through it a final time tomorrow and merge. |
lizthegrey
left a comment
There was a problem hiding this comment.
using atomics is typically a smell that you're doing something else hinky with concurrency. is there an approach that avoids atomics?
Thanks, @lizthegrey. There is a non-atomic alternative: keep ordinary option state and require I chose The atomic is not intended to make concurrent resetters or other lifecycle operations safe. In the earlier review, Klaus explicitly requested removing the reset mutex while saying that the atomic pointer was fine to keep. I implemented that distinction and changed the regression test to use one updater. @klauspost, does this new concern change your earlier preference? If not, I will keep the immutable snapshot approach. |
|
Yeah, the atomic pointer is a bit of a smell. But it does seem like it is fairly cleanly separated and AFAICT it would be practically fine to do a While it would seem reasonable, I am a bit hesitant to commit to it in documentation right away. But having it seems fine. |
ResetWithOptionsupdates decoder options, while reusable frame decoders retain values copied when created, causing inconsistent behavior after reset.Publish immutable option snapshots and capture one per operation so in-flight work keeps its existing settings while subsequent
DecodeAllcalls and streams use the updated options.Summary by CodeRabbit
Bug Fixes
Tests