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 is None in _remove_idle_unusable_session after session.close() #249

Closed
liuxiaocs7 opened this issue Dec 11, 2022 · 0 comments · Fixed by #250
Closed

connection is None in _remove_idle_unusable_session after session.close() #249

liuxiaocs7 opened this issue Dec 11, 2022 · 0 comments · Fixed by #250

Comments

@liuxiaocs7
Copy link
Contributor

liuxiaocs7 commented Dec 11, 2022

I have implement session pool feature to 2.6 refer to the session pool implementation in the master branch (#246), and i find the sessionpool may have the same issue.

after session.release(), session.connection is None, so session._connection.close() will raise an error

if idle_time > self._configs.idle_time:
session.release()
session._connection.close()
self._idle_sessions.remove(session)

def release(self):
"""release the connection to pool, and the session couldn't been use again
:return:
"""
if self._connection is None:
return
self._connection.signout(self._session_id)
self._connection.is_used = False
self._connection = None

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 a pull request may close this issue.

1 participant