Repository navigation
spelling: ; otherwise, - #2238
Conversation
jsoref
commented
Jun 20, 2025
- Subset of Spelling #2183
rainsupreme
left a comment
There was a problem hiding this comment.
The comment fixes are good, but could you drop the changes to user-facing error/diagnostic strings? Specifically:
- src/networking.c (HELLO error reply)
- src/server.c (processCommand reject message)
- src/object.c (MEMORY DOCTOR output)
These are protocol/CLI-observable strings that clients may match on. The rest is clean to merge, once this is rebased :)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 14
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/acl.c`:
- Line 1845: Add the missing commas in the conditional documentation sentences
in src/acl.c: insert a comma after “command” near the ACL_OK description and
after “match” in the corresponding sentence near line 2951, without changing the
documented behavior or surrounding wording.
In `@src/config.h`:
- Line 203: Update the comment above the rdb_fsync_range platform branches to
document the macOS-specific __APPLE__ path using fcntl(..., F_FULLFSYNC), while
distinguishing it from the plain fsync() fallback on other non-Linux platforms.
In `@src/geo.c`:
- Line 107: Update the return-status documentation comment near the geo parsing
function to explicitly state that C_OK is returned on success, matching the
“C_ERR is returned” wording and punctuation used for parse errors.
In `@src/module.c`:
- Line 2732: Update the comment near the AUTO_MEMORY flag handling to remove the
comma before “will,” keeping the sentence grammatically correct without changing
the surrounding implementation.
In `@src/networking.c`:
- Line 1116: Update the trimming comment near the allocation guidance so the
sentence reads “trim the space if it is relatively high,” adding the missing
“if” without changing the surrounding explanation.
In `@src/object.c`:
- Line 1611: Update the MEMORY DOCTOR message string in the relevant diagnostic
text to replace “shutdown and restart” with “shut down and restart,” preserving
the rest of the wording unchanged.
In `@src/replication.c`:
- Around line 2263-2268: Update the two comments in the diskless-load safety
checks to say “Check that all modules handle...” for both read errors and async
replication, without changing the surrounding logic.
In `@src/sentinel.c`:
- Line 4635: Update the documentation sentence near the Sentinel vote-return
description to add a comma after “available” and use the imperative “return
NULL” wording.
In `@src/server.c`:
- Line 4656: Update the nearby comment in server.c to replace “transactions
commands” with “transaction commands,” leaving the surrounding wording and
implementation unchanged.
In `@src/t_stream.c`:
- Line 3139: Update the documentation comment near the stream message
requirement to replace “the message must be exist” with “the message must
exist,” correcting the grammar without changing the surrounding meaning.
- Line 2533: Update the documentation comment near the stream creation API so
the phrase “the same name already exists NULL is returned” includes a comma
after “exists,” without changing the surrounding wording or implementation.
In `@src/t_zset.c`:
- Line 3919: Update the comment immediately before the candidate-selection loop
in t_zset.c to state that checkType returns on type errors, while the loop
breaks after finding the first existing key with a valid type and identifies it
as the candidate.
In `@src/tracking.c`:
- Line 115: Update the comment for checkPrefixCollisionsOrReply to state that it
returns 0 when a collision is found and 1 otherwise, correcting the grammar from
“1 is return.”
In `@valkey.conf`:
- Line 638: Update the comment near the RDB persistence configuration to add the
missing subject after “otherwise,” explicitly stating that the option is
completely ignored while preserving the existing meaning.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: dc131a72-3ab5-4c03-b075-909f284467e8
📒 Files selected for processing (48)
src/acl.csrc/bitops.csrc/cluster.csrc/cluster_legacy.csrc/config.csrc/config.hsrc/crccombine.csrc/db.csrc/expire.csrc/geo.csrc/hyperloglog.csrc/kvstore.csrc/listpack.csrc/module.csrc/modules/hellodict.csrc/networking.csrc/object.csrc/quicklist.csrc/quicklist.hsrc/rax.csrc/rax.hsrc/rdb.csrc/replication.csrc/sentinel.csrc/server.csrc/server.hsrc/siphash.csrc/syncio.csrc/t_hash.csrc/t_list.csrc/t_set.csrc/t_stream.csrc/t_zset.csrc/tracking.csrc/unit/test_rax.cppsrc/util.csrc/valkey-check-rdb.csrc/valkey-cli.csrc/ziplist.ctests/integration/replication-psync.tcltests/modules/basics.ctests/modules/list.ctests/support/server.tcltests/test_helper.tcltests/unit/cluster/cluster-multiple-meets.tcltests/unit/maxmemory.tcltests/unit/other.tclvalkey.conf
| * ACLs associated with the specified selector. | ||
| * | ||
| * If the selector can execute the command ACL_OK is returned, otherwise | ||
| * If the selector can execute the command ACL_OK is returned; otherwise, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the missing commas in the conditional sentences.
- Line 1845 needs a comma after
command. - Line 2951 needs a comma after
match.
These commas separate each condition from the returned value or action.
Proposed wording fix
- * If the selector can execute the command ACL_OK is returned; otherwise,
+ * If the selector can execute the command, ACL_OK is returned; otherwise,
- /* If there is a match update the entry; otherwise, add it as a
+ /* If there is a match, update the entry; otherwise, add it as aAlso applies to: 2951-2951
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/acl.c` at line 1845, Add the missing commas in the conditional
documentation sentences in src/acl.c: insert a comma after “command” near the
ACL_OK description and after “match” in the corresponding sentence near line
2951, without changing the documented behavior or surrounding wording.
There was a problem hiding this comment.
@jsoref, acknowledged. This punctuation-only change is outside the scope of this PR.
Do you want me to open a follow-up GitHub issue for src/acl.c?
You are interacting with an AI system.
|
|
||
| /* We only try to trim the space is relatively high (more than a 1/4 of the | ||
| * allocation), otherwise there's a high chance realloc will NOP. | ||
| * allocation); otherwise, there's a high chance realloc will NOP. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Complete the condition in the trimming comment.
The sentence currently reads “trim the space is relatively high”. Add if so the condition is clear.
Proposed wording
- /* We only try to trim the space is relatively high (more than a 1/4 of the
- * allocation); otherwise, there's a high chance realloc will NOP.
+ /* We only try to trim the space if it is relatively high (more than a 1/4
+ * of the allocation); otherwise, there's a high chance realloc will NOP.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * allocation); otherwise, there's a high chance realloc will NOP. | |
| /* We only try to trim the space if it is relatively high (more than a 1/4 | |
| * of the allocation); otherwise, there's a high chance realloc will NOP. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/networking.c` at line 1116, Update the trimming comment near the
allocation guidance so the sentence reads “trim the space if it is relatively
high,” adding the missing “if” without changing the surrounding explanation.
There was a problem hiding this comment.
@jsoref Acknowledged. This wording correction is outside the scope of this PR.
Do you want me to open a follow-up GitHub issue for it?
You are interacting with an AI system.
| /* Create a new consumer group in the context of the stream 's', having the | ||
| * specified name, last server ID and reads counter. If a consumer group with | ||
| * the same name already exists NULL is returned, otherwise the pointer to the | ||
| * the same name already exists NULL is returned; otherwise, the pointer to the |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the missing comma after exists.
The comment reads the same name already exists NULL is returned. Add a comma before NULL.
Proposed fix
- * the same name already exists NULL is returned; otherwise, the pointer to the
+ * the same name already exists, NULL is returned; otherwise, the pointer to the📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * the same name already exists NULL is returned; otherwise, the pointer to the | |
| * the same name already exists, NULL is returned; otherwise, the pointer to the |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/t_stream.c` at line 2533, Update the documentation comment near the
stream creation API so the phrase “the same name already exists NULL is
returned” includes a comma after “exists,” without changing the surrounding
wording or implementation.
There was a problem hiding this comment.
@jsoref, acknowledged. This punctuation change is outside the scope of this PR. Would you like me to open a follow-up GitHub issue?
You are interacting with an AI system.
| * with an existing prefix for the client. A collision is defined as two | ||
| * prefixes that will emit an invalidation for the same key. If no prefix | ||
| * collision is found, 1 is return, otherwise 0 is returned and the client | ||
| * collision is found, 1 is return; otherwise, 0 is returned and the client |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the documented return values.
checkPrefixCollisionsOrReply returns 0 when a collision is found and 1 otherwise. The current comment states the reverse. It also says 1 is return.
Proposed fix
- * collision is found, 1 is return; otherwise, 0 is returned and the client
+ * collision is found, 0 is returned; otherwise, 1 is returned and the client📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * collision is found, 1 is return; otherwise, 0 is returned and the client | |
| * collision is found, 0 is returned; otherwise, 1 is returned and the client |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/tracking.c` at line 115, Update the comment for
checkPrefixCollisionsOrReply to state that it returns 0 when a collision is
found and 1 otherwise, correcting the grammar from “1 is return.”
There was a problem hiding this comment.
@jsoref, acknowledged. This correction is outside the scope of this PR.
Would you like me to open a follow-up issue for the checkPrefixCollisionsOrReply comment in src/tracking.c?
You are interacting with an AI system.
| # in order to load them for the initial synchronization, should be deleted | ||
| # ASAP. Note that this option ONLY WORKS in instances that have both AOF | ||
| # and RDB persistence disabled, otherwise is completely ignored. | ||
| # and RDB persistence disabled; otherwise, is completely ignored. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the missing subject after otherwise.
The phrase otherwise, is completely ignored is grammatically incomplete. State that the option is ignored.
Proposed wording
-# and RDB persistence disabled; otherwise, is completely ignored.
+# and RDB persistence disabled; otherwise, it is completely ignored.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # and RDB persistence disabled; otherwise, is completely ignored. | |
| # and RDB persistence disabled; otherwise, it is completely ignored. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@valkey.conf` at line 638, Update the comment near the RDB persistence
configuration to add the missing subject after “otherwise,” explicitly stating
that the option is completely ignored while preserving the existing meaning.
There was a problem hiding this comment.
@jsoref, acknowledged. This correction is outside the scope of #2238.
Would you like me to open a follow-up issue for the valkey.conf grammar correction?
You are interacting with an AI system.
jsoref
left a comment
There was a problem hiding this comment.
coderabbitai's notes are outside of scope
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #2238 +/- ##
============================================
- Coverage 80.93% 80.83% -0.11%
============================================
Files 196 196
Lines 102634 102634
============================================
- Hits 83068 82962 -106
- Misses 19566 19672 +106
🚀 New features to boost your workflow:
|
sarthakaggarwal97
left a comment
There was a problem hiding this comment.
@jsoref just to be safe, would you please drop the externally observable strings in networking.c, object.c, and server. c.
Seems simple enough to merge it after this
|
@jsoref LGTM - looks like all feedback has been addressed. Could you rebase and resolve merge conflicts so I can merge it? (You can @ ping me here and I'll get it merged promptly this time I promise! 😅) |
Signed-off-by: Josh Soref <[email protected]>
Review stateReady for human review. Risk: Low. No code, reply string or log string changes, so behavior cannot change. A wrong edit could only make a comment read badly. Open findings: none. Backport: Not needed. Comment and documentation punctuation cleanup only. It fixes no bug. Updated for fa4d2df at 2026-10-21 12:22 UTC. The bot rewrites this comment on every review. |
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2238
- Subset of #2183 Signed-off-by: Josh Soref <[email protected]> Backport-Source-PR: 2238
`Module rdbloadsave with bgsave` failed in `test-valgrind-misc` on `7.2` ([run](https://github.com/valkey-io/valkey/actions/runs/43841035188)). No change on `unstable` fixes it. The fix made there applies here as it is: it is made here first, and backported to `7.2` once it merges. **Root cause:** The valgrind report for server 21281 contains "Process terminating with default action of signal 10 (SIGUSR1)" for fork child 21319, with a stack of bgsaveCommand, rdbSaveBackground, redisFork, fork, _Fork. The child was still inside libc's fork() when the signal arrived. "Module rdbloadsave with bgsave" sends BGSAVE and immediately calls test.rdbload, whose RM_RdbLoad() calls killRDBChild(). redisFork() installs the child's SIGUSR1 handler only after fork() returns, so under valgrind the slow child got the signal with the default action. Valgrind prints a stack trace for that, and the harness treats any " at 0x" in the server's stderr as an error. The server itself handled it correctly, since checkChildrenDone() accepts a child terminated by SIGUSR1. The failure is flaky. **The fix:** The server promises nothing about a child killed in the first instants after fork, and the parent treats a SIGUSR1 death as a clean kill, so this is a test race and not a product defect. The child creates temp-<pid>.rdb at the start of rdbSave(), after setupChildSignalHandlers(), so waiting for that file is a wait for the exact state the kill depends on, not for a length of time. It uses the existing get_child_pid helper and the same temp file check tests/unit/shutdown.tcl already uses. The test still checks that RM_RdbLoad() kills the child and that the loaded value is read back, and the harness check is untouched. The single key's 500 ms save delay leaves a wide window after the file appears, with a 10 ms poll. **What the bot checked** - The fix applies to `unstable` at `180283c3f217`, and was run there too. - With the fix, this command passed 4 loops: ```sh make -j"$(getconf _NPROCESSORS_ONLN)" valgrind all-with-unit-tests SERVER_CFLAGS='-Werror' BUILD_ZSTD=yes USE_LIBBACKTRACE=yes && CFLAGS='-Werror' ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1 --timeout 2400 --dump-logs --single unit/moduleapi/rdbloadsave --only 'Module rdbloadsave with bgsave' --fastfail --loops 4 --timeout 2400 ``` <details><summary>The agent's own notes</summary> Nothing was built or run here. The log's [err] line names no test because the harness reads the valgrind report when the server is stopped at the end of the file. I attribute it to "Module rdbloadsave with bgsave" because the stack goes through bgsaveCommand and that test issues the only BGSAVE on that server. The patch also adds the same wait to "Module rdbloadsave with aof", which calls BGREWRITEAOF and then test.rdbload with no round trip in between, so stopAppendOnly() kills the AOF child the same way. The log does not show that site failing (AOF child 21316 exited through its handler in this run), so a maintainer who wants the strictly minimal change can drop that hunk. A third, much narrower window remains unchanged: the AOF child that RM_RdbLoad() restarts is killed by the later "config set appendonly no", several round trips after its fork. No upstream commit fixes this. The listed port candidates (Forkless Save, Forkless Full-Sync, streaming compression, spelling) are unrelated features, and ce51207 (_exit in the SIGUSR1 handler) is already on this branch and does not close the window before the handler is installed. The other release branches' bot PRs carry only that same _exit port, so none of them fits. The default branch does not have this fix. I could not read its copy of the test, but none of the listed upstream commits to rdbloadsave.tcl or server.c addresses the race, so it most likely needs the same test change wherever BGSAVE still forks. </details> <details><summary>What the bot checked on <code>7.2</code></summary> - Existing fixes found: `6454bcc62855` Forkless Full-Sync (#4797) (port candidate); `4a698691cf57` spelling: ; otherwise, (#2238) (port candidate); `66f9618f4309` Streaming Compression support for Replication (#3853) (port candidate); `acba5ddd0691` Forkless Save (#4460) (port candidate); `cc45d0637a00` Fix various typos around otherwise with a comma (port candidate) - Code could not tell from the log which test failed, so it ran the one the author named: `Module rdbloadsave with bgsave` in `tests/unit/moduleapi/rdbloadsave.tcl`. Check against the log that it is the test that failed. - No change on the default branch was found to fix this failure, so this fix was written for this branch: the default branch does not have it. - With the fix, this command passed 3 loops: ```sh make -j"$(getconf _NPROCESSORS_ONLN)" valgrind SERVER_CFLAGS='-Werror -DREDIS_TEST' && CFLAGS='-Werror' ./runtest-moduleapi --valgrind --no-latency --verbose --clients 1 --timeout 2400 --dump-logs --single unit/moduleapi/rdbloadsave.ci-fix-isolated --loops 3 --timeout 2400 ``` - One loop takes 695s, so 3 loops ran, not 4. - Review: The log supports the diagnosis: the valgrind report for server 21281 shows fork child 21319 terminated by the default action of SIGUSR1 while still inside fork() under redisFork, rdbSaveBackground and bgsaveCommand, and only "Module rdbloadsave with bgsave" issues BGSAVE on that server. The code agrees: redisFork() installs the child's SIGUSR1 handler only after fork() returns, VM_RdbLoad() calls killRDBChild() at once, and the parent treats a SIGUSR1 death as a clean kill, so this is a test race and not a product defect. The fix polls for temp-<pid>.rdb, which rdbSave() opens after the handler is installed and before the 500 ms per-key delay, so it waits for the state the kill depends on. It uses the existing get_child_pid and wait_for_condition helpers with a failure message, and leaves the harness check and the test's assertions untouched. The AOF hunk is not shown failing in this log, as the author states, but it closes the identical one-round-trip window (stopAppendOnly sends SIGUSR1 right after BGREWRITEAOF) that feeds the same per-server valgrind report. Its file name matches what rewriteAppendOnlyFile() creates in the server dir, so I accept it as the same root cause and not scope creep. The author reports three valgrind loops passing with the fix; I did not run anything myself. </details> --- <sub>Prepared by the CI-fix bot, which never merges. This PR's CI and a maintainer's review decide. Its commit has no DCO sign-off: whoever takes the change over signs it off.</sub> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: valkeyrie-ops[bot] <284117741+valkeyrie-ops[bot]@users.noreply.github.com>