Exit with error when getRDB ftruncate fails#3945
Conversation
Previously a failed ftruncate printed a warning but still reported 'Transfer finished with success' and exited 0, leaving a corrupt RDB file that looked successful. Exit non-zero to match the write() failure handling in the same function. Signed-off-by: Grace <glucier22@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe RDB file write path in ChangesRDB File Truncation Error Handling
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)src/valkey-cli.csrc/valkey-cli.c:53:10: fatal error: 'valkey/valkey.h' file not found ... [truncated 695 characters] ... "/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/lib/clang/18/include" Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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 |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #3945 +/- ##
============================================
- Coverage 76.68% 76.67% -0.01%
============================================
Files 162 162
Lines 80731 80734 +3
============================================
- Hits 61910 61905 -5
- Misses 18821 18829 +8
🚀 New features to boost your workflow:
|
When `valkey-cli --rdb` trims the EOF marker, a failed `ftruncate` only printed a warning but still reported success and exited 0, leaving a corrupt RDB file. This makes it exit non-zero on that failure, matching how the `write()` failure is already handled in the same function. (Thank you, Madelyn, for tag teaming this with me.) (cherry picked from commit 69d3f50) Signed-off-by: Grace <glucier22@gmail.com> Co-authored-by: gluxier <glucier@linuxfoundation.org>
When
valkey-cli --rdbtrims the EOF marker, a failedftruncateonly printed a warning but still reported success and exited 0, leaving a corrupt RDB file. This makes it exit non-zero on that failure, matching how thewrite()failure is already handled in the same function.(Thank you, Madelyn, for tag teaming this with me.)