Skip to content

Fix missing response when AUTH is errored inside a transaction#2287

Merged
ranshid merged 2 commits into
valkey-io:unstablefrom
enjoy-binbin:auth_multi
Jul 1, 2025
Merged

Fix missing response when AUTH is errored inside a transaction#2287
ranshid merged 2 commits into
valkey-io:unstablefrom
enjoy-binbin:auth_multi

Conversation

@enjoy-binbin

Copy link
Copy Markdown
Member

When we add f8a5a4f, a module auth
can add reply in its callback, or not add reply and just return an
error robj in its callback, and we have to figure a way to determine
whether it has added the reply.

Before we are using clientHasPendingReplies and it had a issue,
the auth might be used inside a transaction or pipeline which already
has some pending replies in the client reply list. It causes us to
not add the error reply to auth.

After #1819, now we have a buffered_reply client flag, it indicates
the reply for the current command was buffered, either in client::reply
or in client::buf. We can use this flag to check.

Fixes #2106.

When we add f8a5a4f, a module auth
can add reply in its callback, or not add reply and just return an
error robj in its callback, and we have to figure a way to determine
whether it has added the reply.

Before we are using `clientHasPendingReplies` and it had a issue,
the auth might be used inside a transaction or pipeline which already
has some pending replies in the client reply list. It causes us to
not add the error reply to auth.

After valkey-io#1819, now we have a buffered_reply client flag, it indicates
the reply for the current command was buffered, either in client::reply
or in client::buf. We can use this flag to check.

Fixes valkey-io#2106.

Signed-off-by: Binbin <binloveplay1314@qq.com>
@codecov

codecov Bot commented Jun 30, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.50%. Comparing base (d37dc52) to head (5b29c2c).
Report is 5 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2287      +/-   ##
============================================
+ Coverage     71.46%   71.50%   +0.03%     
============================================
  Files           123      123              
  Lines         66927    66936       +9     
============================================
+ Hits          47831    47860      +29     
+ Misses        19096    19076      -20     
Files with missing lines Coverage Δ
src/acl.c 90.72% <100.00%> (ø)

... and 16 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.

@madolson madolson moved this to Todo in Valkey 9.0 Jun 30, 2025

@ranshid ranshid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally LGTM. small comment to improve the documentation.

Comment thread src/acl.c
Signed-off-by: Binbin <binloveplay1314@qq.com>
@ranshid ranshid merged commit fc7c04e into valkey-io:unstable Jul 1, 2025
52 checks passed
@github-project-automation github-project-automation Bot moved this to To be backported in Valkey 8.1 Jul 1, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Valkey 9.0 Jul 1, 2025
@ranshid

ranshid commented Jul 1, 2025

Copy link
Copy Markdown
Member

@enjoy-binbin will you cherry pick to 8.1?

@enjoy-binbin enjoy-binbin deleted the auth_multi branch July 2, 2025 01:45
enjoy-binbin added a commit to enjoy-binbin/valkey that referenced this pull request Jul 2, 2025
…y-io#2287)

When we add f8a5a4f, a module auth
can add reply in its callback, or not add reply and just return an
error robj in its callback, and we have to figure a way to determine
whether it has added the reply.

Before we are using `clientHasPendingReplies` and it had a issue,
the auth might be used inside a transaction or pipeline which already
has some pending replies in the client reply list. It causes us to
not add the error reply to auth.

After valkey-io#1819, now we have a buffered_reply client flag, it indicates
the reply for the current command was buffered, either in client::reply
or in client::buf. We can use this flag to check.

Fixes valkey-io#2106.

---------

Signed-off-by: Binbin <binloveplay1314@qq.com>
@enjoy-binbin

enjoy-binbin commented Jul 2, 2025

Copy link
Copy Markdown
Member Author

2b19817
pushed the commit to 8.1 branch

I dont know how to handle the projects label, we need a new 8.1.3 project?

@enjoy-binbin enjoy-binbin added the release-notes This issue should get a line item in the release notes label Jul 2, 2025
@ranshid ranshid moved this from To be backported to Done in Valkey 8.1 Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes This issue should get a line item in the release notes

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] missing response when AUTH is errored inside a transaction

3 participants