Fix incorrect server.cronloops update in defragWhileBlocked() causing timer to run twice as fast#14081
Merged
sundb merged 1 commit intoredis:unstablefrom May 27, 2025
Merged
Conversation
… timer to run twice as fast
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
guybe7
approved these changes
May 27, 2025
YaacovHazan
pushed a commit
to YaacovHazan/redis
that referenced
this pull request
May 27, 2025
… timer to run twice as fast (redis#14081) This bug was introduced in [redis#13814](redis#13814), and was found by @guybe7. It incorrectly moved the update of `server.cronloops` from `whileBlockedCron()` to `activeDefragTimeProc()`, causing the cron-based timers to effectively run twice as fast when active defrag is enabled. As a result, memory statistics are not updated during blocked operations. The repair parts from redis#13995, because it needs to be backport, so use a separate pr repair it.
YaacovHazan
pushed a commit
that referenced
this pull request
May 27, 2025
… timer to run twice as fast (#14081) This bug was introduced in [#13814](#13814), and was found by @guybe7. It incorrectly moved the update of `server.cronloops` from `whileBlockedCron()` to `activeDefragTimeProc()`, causing the cron-based timers to effectively run twice as fast when active defrag is enabled. As a result, memory statistics are not updated during blocked operations. The repair parts from #13995, because it needs to be backport, so use a separate pr repair it.
funny-dog
pushed a commit
to funny-dog/redis
that referenced
this pull request
Sep 17, 2025
… timer to run twice as fast (redis#14081) This bug was introduced in [redis#13814](redis#13814), and was found by @guybe7. It incorrectly moved the update of `server.cronloops` from `whileBlockedCron()` to `activeDefragTimeProc()`, causing the cron-based timers to effectively run twice as fast when active defrag is enabled. As a result, memory statistics are not updated during blocked operations. The repair parts from redis#13995, because it needs to be backport, so use a separate pr repair it.
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.
This bug was introduced in #13814, and was found by @guybe7.
It incorrectly moved the update of
server.cronloopsfromwhileBlockedCron()toactiveDefragTimeProc(),causing the cron-based timers to effectively run twice as fast when active defrag is enabled.
As a result, memory statistics are not updated during blocked operations.
The repair parts from #13995, because it needs to be backport, so use a separate pr repair it.
Reproduce steps
redis/src/server.c
Lines 1496 to 1507 in 6349a7c
The above log should be printed every five seconds.
config
before this PR:
after this PR: