Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Add auto_close_connection_pool and close_connection_pool in Redis.close() #1256

Merged
merged 4 commits into from
Feb 4, 2022

Conversation

Andrew-Chen-Wang
Copy link
Collaborator

Signed-off-by: Andrew-Chen-Wang acwangpython@gmail.com

What do these changes do?

Add auto_close_connection_pool for Redis-created connection pools, not manually created pools. Adds close_connection_pool in Redis.close() for manual override on whether to close connection pool or not.

Are there changes in behavior for the user?

Yes, connection pools automatically disconnect. The user may still disconnect all connections from the connection pools themselves, but it is safe to remove their code for doing so. It is also safe to leave it as is.

Related issue number

Fixes #1103

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example:
      Fix issue with non-ascii contents in doctest text files.

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
@Andrew-Chen-Wang

This comment has been minimized.

@codecov
Copy link

codecov bot commented Jan 3, 2022

Codecov Report

Merging #1256 (7e47114) into master (56d6b32) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1256      +/-   ##
==========================================
+ Coverage   90.66%   90.68%   +0.01%     
==========================================
  Files          21       21              
  Lines        6870     6926      +56     
  Branches      884      888       +4     
==========================================
+ Hits         6229     6281      +52     
- Misses        469      471       +2     
- Partials      172      174       +2     
Flag Coverage Δ
unit 90.60% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aioredis/client.py 82.39% <100.00%> (-0.08%) ⬇️
tests/test_connection_pool.py 99.37% <100.00%> (+0.07%) ⬆️
aioredis/connection.py 77.18% <0.00%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56d6b32...7e47114. Read the comment docs.

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

Successfully merging this pull request may close these issues.

Redis.close() doesn't close connection pool created in __init__
2 participants