Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection: fix getpid() call on disconnect #166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkmkme
Copy link
Collaborator

@mkmkme mkmkme commented Dec 23, 2024

Previous fix only handled the connections from Valkey class, which left classes like Sentinel broken because those are handled in AbstractConnection.
Also after merging previous fix I was pointed to the place in Python standard library where the similar issue was handled by having from os import getpid instead of having a local object assigned to os.getpid.

Fixes #158

Pull Request check-list

  • 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)?

Description of change

Previous fix only handled the connections from `Valkey` class, which
left classes like `Sentinel` broken because those are handled in
`AbstractConnection`.
Also after merging previous fix I was pointed to the place in Python
standard library where the similar issue was handled by having
`from os import getpid` instead of having a local object assigned to
`os.getpid`.

Fixes valkey-io#158

Signed-off-by: Mikhail Koviazin <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.22%. Comparing base (ef40c56) to head (a2c27a9).

Files with missing lines Patch % Lines
valkey/connection.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
- Coverage   76.23%   76.22%   -0.01%     
==========================================
  Files         130      130              
  Lines       33947    33946       -1     
==========================================
- Hits        25879    25877       -2     
- Misses       8068     8069       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Django runserver throws AttributeError on closing
2 participants