Skip to content

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Fixes #3366

@petyaslavova petyaslavova added the maintenance Maintenance (CI, Releases, etc) label Oct 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the BlockingConnectionPool.disconnect() method to align with the ConnectionPoolInterface definition by adding an inuse_connections parameter. The change allows selective disconnection of either all connections or only free connections in the pool.

  • Adds inuse_connections parameter to BlockingConnectionPool.disconnect() method
  • Updates test infrastructure with connection state tracking
  • Adds comprehensive test coverage for both sync and async connection pool disconnect behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
redis/connection.py Modified BlockingConnectionPool.disconnect() to accept inuse_connections parameter and conditionally disconnect connections based on this flag
tests/test_connection_pool.py Enhanced DummyConnection with socket state tracking and added test_pool_disconnect tests for both standard and blocking connection pools
tests/test_asyncio/test_connection_pool.py Updated async DummyConnection with connection state tracking, renamed existing test, and added comprehensive disconnect tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@petyaslavova petyaslavova force-pushed the ps_fix_lsp_violation_blocking_connection_pool branch from 1fd1064 to f4c48ff Compare October 17, 2025 11:11
@petyaslavova petyaslavova force-pushed the ps_fix_lsp_violation_blocking_connection_pool branch from f4c48ff to 162d07b Compare October 21, 2025 10:43
@petyaslavova petyaslavova merged commit f2d97b2 into master Oct 21, 2025
40 checks passed
@petyaslavova petyaslavova deleted the ps_fix_lsp_violation_blocking_connection_pool branch October 21, 2025 14:31
petyaslavova added a commit that referenced this pull request Oct 21, 2025
…definition in ConnectionPoolInterface (#3802)

* Fixing sync BlockingConnectionPool's disconnect method to follow the definition of the interface

* Fixing linter errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance (CI, Releases, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Violated LSP in BlockingConnectionPool makes it impossible to inherit from it

2 participants