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

chore: fix session pool del before lock #367

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.9, '3.10', 3.11]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should be fine as we have test coverage running over 3.7 w/o PDM already, plus PDM now is 3.8+ actually.


steps:
- name: Maximize runner space
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ See [ScanVertexEdgeExample.py](example/ScanVertexEdgeExample.py) for more detail

| Nebula-Python Version | Compatible NebulaGraph Versions | Notes |
| --------------------- | ------------------------------- | ---------------------------------------------------------- |
| 3.8.2 | 3.x | Highly recommended. Latest release for NebulaGraph 3.x series. |
| 3.8.3 | 3.x | Highly recommended. Latest release for NebulaGraph 3.x series. |
| master | master | Includes recent changes. Not yet released. |
| 3.0.0 ~ 3.5.1 | 3.x | Compatible with any released version within the NebulaGraph 3.x series. |
| 2.6.0 | 2.6.0, 2.6.1 | |
Expand Down
3 changes: 2 additions & 1 deletion nebula3/gclient/net/SessionPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def __init__(self, username, password, space_name, addresses):
self._close = False

def __del__(self):
self.close()
if hasattr(self, '_lock'):
self.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

the root cause is when init the pool if the address is invalid, would raise exception
so the object has no _lock property.

prefer move the exception at the end of init function
and the every object has _lock property.

Copy link
Contributor

Choose a reason for hiding this comment

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

the current change it's also ok for me.
there's the same issue with meta client, please fix it in the same way


def init(
self,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nebula3-python"
version = "3.8.2"
version = "3.8.3"
description = "Python client for NebulaGraph v3"
authors = [
{name = "vesoft-inc", email = "[email protected]"},
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

setup(
name="nebula3-python",
version="3.8.2",
version="3.8.3",
license="Apache 2.0",
author="vesoft-inc",
author_email="[email protected]",
Expand Down
Loading