Skip to content

change check order for xautoclaim #2318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Conversation

charsyam
Copy link
Contributor

@charsyam charsyam commented Jul 7, 2025

change check order for xautocommit parameters

I think it is more readable and eailer.

because we already checked object is existed by lookupKeyRead at the beginning of code.

and it is a little bit faster when key is not exist.

@charsyam charsyam force-pushed the change_check_order branch from 128bc26 to 2a82deb Compare July 7, 2025 07:35
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.43%. Comparing base (cb10d9d) to head (2a82deb).

Files with missing lines Patch % Lines
src/t_stream.c 71.42% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2318      +/-   ##
============================================
- Coverage     71.44%   71.43%   -0.02%     
============================================
  Files           123      123              
  Lines         67086    67086              
============================================
- Hits          47931    47922       -9     
- Misses        19155    19164       +9     
Files with missing lines Coverage Δ
src/t_stream.c 92.72% <71.42%> (-0.61%) ⬇️

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +3320 to +3323
if (o == NULL) {
addReplyErrorFormat(c, "-NOGROUP No such key '%s'", (char *)c->argv[1]->ptr);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the correct error message. If I understand correctly, -NOGROUP typically means the consumer group doesn't exist for the key, not that the key itself is missing. In this case, the error seems more related to the key not existing at all, so maybe a different error message would be more appropriate.

Comment on lines 3359 to 3360
/* No key or group? Send an error given that the group creation
* is mandatory. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change comment if it is necessary

Comment on lines +3361 to +3362
if (group == NULL) {
addReplyErrorFormat(c, "-NOGROUP No consumer group '%s'", (char *)c->argv[2]->ptr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I know why the group null check is still needed here, now that the key existence check has been moved earlier? I'm also wondering if there is a specific reason to keep the group check separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants