Skip to content

Pool fixes - #3182

Merged
nkaradzhov merged 5 commits into
redis:masterfrom
nkaradzhov:pool-fixes
Feb 25, 2026
Merged

nkaradzhov merged 5 commits into
redis:masterfrom
nkaradzhov:pool-fixes

Conversation

@nkaradzhov

Copy link
Copy Markdown
Collaborator

This PR adresses several pool issues. Some of those were mentioned in #3152
Namely:

  • pool didnt set isOpen to false on close
  • close didnt wait in-flight/queued tasks when closing
  • pool didnt reject new commands after close is called

- Added #drainResolve field to signal when all tasks are drained
- Updated #returnClient() to signal drain completion when closing
- Updated close() to wait for tasks before closing clients
- Added test to verify close() waits for both in-flight and queued tasks

Fixes part of redis#3152
- Added guard check in execute() to reject with ClientClosedError when #isClosing or !#isOpen
- All entry points (execute, sendCommand, ping, multi, etc.) are protected since they all funnel through execute()
- Added tests verifying execute(), sendCommand(), ping(), and multi().exec() all reject appropriately

Fixes part of redis#3152

@PavelPashov PavelPashov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@nkaradzhov
nkaradzhov merged commit e6658f9 into redis:master Feb 25, 2026
15 checks passed
@nkaradzhov
nkaradzhov deleted the pool-fixes branch February 25, 2026 09:27
@coderabbitai coderabbitai Bot mentioned this pull request Apr 21, 2026
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