You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2022/02/18 14:24:48 UTC
[GitHub] [tinkerpop] spmallette opened a new pull request #1571: TINKERPOP-2707 Close of parent connection also calls close on spawned child sessions.
spmallette opened a new pull request #1571:
URL: https://github.com/apache/tinkerpop/pull/1571
https://issues.apache.org/jira/browse/TINKERPOP-2707
Not closing these sessions could end in a leak if a user opts to get a little loose with the expected API calls for properly handling sessions. This change should prevent accidents.
Builds with `mvn clean install -pl gremlin-python`
VOTE +1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] lyndonb-bq commented on a change in pull request #1571: TINKERPOP-2707 Close of parent connection also calls close on spawned child sessions.
Posted by GitBox <gi...@apache.org>.
lyndonb-bq commented on a change in pull request #1571:
URL: https://github.com/apache/tinkerpop/pull/1571#discussion_r810221316
##########
File path: gremlin-python/src/main/python/gremlin_python/driver/driver_remote_connection.py
##########
@@ -74,7 +79,19 @@ def __init__(self, url, traversal_source="g", protocol_factory=None,
self._traversal_source = self._client._traversal_source
def close(self):
- logging.info("closing DriverRemoteConnection with url '%s'", str(self._url))
+ # close this client and any DriverRemoteConnection instances spawned from this one
+ # for a session
+ if len(self.__spawned_sessions) > 0:
+ logging.info("closing spawned sessions from DriverRemoteConnection with url '%s'", str(self._url))
+ for spawned_session in self.__spawned_sessions:
+ spawned_session.close()
+
+ if self.__session:
+ logging.info("closing DriverRemoteConnection with url '%s' with session '%s'",
+ str(self._url), self.__session)
Review comment:
Does this print correctly? I thought the session object in the DriverRemoteConnection class was technical a uuid object, I am wondering if self.__session should be wrapped in an `str` like so:
```suggestion
str(self._url), str(self.__session))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] spmallette merged pull request #1571: TINKERPOP-2707 Close of parent connection also calls close on spawned child sessions.
Posted by GitBox <gi...@apache.org>.
spmallette merged pull request #1571:
URL: https://github.com/apache/tinkerpop/pull/1571
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] lyndonb-bq commented on a change in pull request #1571: TINKERPOP-2707 Close of parent connection also calls close on spawned child sessions.
Posted by GitBox <gi...@apache.org>.
lyndonb-bq commented on a change in pull request #1571:
URL: https://github.com/apache/tinkerpop/pull/1571#discussion_r810224454
##########
File path: gremlin-python/src/main/python/gremlin_python/driver/driver_remote_connection.py
##########
@@ -74,7 +79,19 @@ def __init__(self, url, traversal_source="g", protocol_factory=None,
self._traversal_source = self._client._traversal_source
def close(self):
- logging.info("closing DriverRemoteConnection with url '%s'", str(self._url))
+ # close this client and any DriverRemoteConnection instances spawned from this one
+ # for a session
+ if len(self.__spawned_sessions) > 0:
+ logging.info("closing spawned sessions from DriverRemoteConnection with url '%s'", str(self._url))
+ for spawned_session in self.__spawned_sessions:
+ spawned_session.close()
+
Review comment:
Perhaps we should clear the list here, since all the connections maintained in the list are now closed?
```suggestion
for spawned_session in self.__spawned_sessions:
spawned_session.close()
self.__spawned_sessions.clear()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org