GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — keep reading the map in processMapKeyValueReply after a nested error by insaf021 · Pull Request #4841 · redis/jedis

Conversation

@insaf021

@insaf021 insaf021 commented Nov 14, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Default RedisClient (RESP3 negotiated), pool maxTotal=1, Redis 8.10.3. A script stores redis.pcall results in a map and counter:b holds a non-integer:

EVAL "local out = {} for _, k in ipairs(KEYS) do out[k] = redis.pcall('INCR', k) end return {map=out}" 3 counter:a counter:b counter:c
<- %3 $9 counter:a :1 $9 counter:b -ERR value is not an integer or out of range $9 counter:c :1

eval threw JedisDataException: ERR value is not an integer or out of range
GET profile:alice -> counter:c
GET profile:bob   threw ClassCastException: class java.lang.Long cannot be cast to class [B
GET profile:carol -> [email protected]
GET profile:dave  -> [email protected]

processMapKeyValueReply calls process() for each key and value without catching JedisDataException, so it stops at the nested error and leaves the rest of the map on the socket. readProtocolWithCheckingBroken treats a JedisDataException as a fully parsed reply and does not mark the connection broken, so the pool hands it out again and every later reply on it is off by one, giving one caller another caller's data.

processMultiBulkReply already keeps a nested error as the element and carries on reading. The map path now does the same, so eval/fcall return the error as that entry's value, as they already do for the RESP2 array form of the same reply. RESP3 has been negotiated by default since 8.0, so this hits default RedisClient/RedisClusterClient setups whenever a script or function returns a map with an error inside.

ProtocolRepliesTest pinned the old throw for a map value; it now checks the copy like the array, set and push cases. New tests in ProtocolTest and ScriptingCommandsTest fail before the change (the latter on its RESP3 parameter) and pass after; release-notes entry added.


Note

Medium Risk
Fixes a serious pooled-connection reply misalignment bug; changes error handling for map/script replies that embed errors instead of failing the whole command.

Overview
Fixes a connection desync on RESP3 when a map reply includes a nested error (e.g. Lua {map=...} with redis.pcall failures). Parsing used to stop at the first JedisDataException, leave unread map bytes on the socket, and keep the connection in the pool—later commands could receive another caller's shifted replies.

processMapKeyValueReply now reads every key/value via processMapElement, which retains nested errors as map values (matching processMultiBulkReply). eval/fcall return the map instead of throwing for that case; callers should inspect values for JedisDataException.

Release notes, unit tests (ProtocolTest, ProtocolRepliesTest), and an integration test (evalMapWithPcallErrorKeepsConnectionInSync) cover the new behavior.

Reviewed by Cursor Bugbot for commit 046b022. Bugbot is set up for automated code reviews on this repo. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@insaf021
keep reading the map in processMapKeyValueReply after a nested error
c43ff8e
A RESP3 map reply with an error value, e.g. a script returning
{map=...} that holds a redis.pcall error, stopped parsing at the error.
readProtocolWithCheckingBroken treats JedisDataException as a fully
parsed reply, so the connection went back to the pool with the rest of
the map unread and every later reply on it was shifted by one.

Keep a nested error as the map element, as processMultiBulkReply
already does for arrays, so the whole map is consumed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T05:22:05.082535Z c43ff8e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ggivo
Merge branch 'master' into resp3-map-nested-error
046b022
@ggivo

ggivo commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pr, team will take a look shortly

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ggivo ggivo added the waiting-for-triage Still needs to be triaged label Nov 17, 2026
ggivo
ggivo approved these changes Nov 17, 2026
View reviewed changes
@ggivo
ggivo merged commit 1477d8c into redis:master Nov 17, 2026
20 of 22 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ggivo ggivo added bug and removed waiting-for-triage Still needs to be triaged labels Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ggivo ggivo ggivo approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@insaf021 @ggivo
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.