Prevent double-free of the module timer when the callback stops it#4211
Open
quanyeyang wants to merge 3 commits into
Open
Prevent double-free of the module timer when the callback stops it#4211quanyeyang wants to merge 3 commits into
quanyeyang wants to merge 3 commits into
Conversation
Signed-off-by: quanyeyang <quanyemostima@gmail.com>
📝 WalkthroughWalkthroughModule timer dispatch now safely handles callbacks that stop their own timers. The timer test module adds a self-stopping command and unit coverage verifying callback execution, timer removal, and continued server responsiveness. ChangesSelf-stopping timer handling
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #4211 +/- ##
============================================
- Coverage 76.81% 76.81% -0.01%
============================================
Files 162 162
Lines 81455 81459 +4
============================================
Hits 62570 62570
- Misses 18885 18889 +4
🚀 New features to boost your workflow:
|
Signed-off-by: quanyeyang <quanyemostima@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
moduleTimerHandler()when a module timer callback callsValkeyModule_StopTimer()on the currently firing timer (VM_StopTimerfrees the object, then the dispatcher freed it again).Timers.Fixes #4200
Test plan
./runtest --single unit/moduleapi/timer