[ 
https://issues.apache.org/jira/browse/TINKERPOP-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16792816#comment-16792816
 ] 

ASF GitHub Bot commented on TINKERPOP-2135:
-------------------------------------------

FlorianHockmann commented on pull request #1077: TINKERPOP-2135/2148 Fix 
removal of closed connections and add round-robin scheduling
URL: https://github.com/apache/tinkerpop/pull/1077
 
 
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Gremlin.Net ConnectionPool doesn't handle closed idle connections properly
> --------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2135
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2135
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: dotnet
>    Affects Versions: 3.4.0
>            Reporter: Florian Hockmann
>            Assignee: Florian Hockmann
>            Priority: Major
>
> The {{ConnectionPool}} of Gremlin.Net checks whether a connection is actually 
> still open before it returns that connection to execute a request ([in 
> {{SelectLeastUsedConnection}}|https://github.com/apache/tinkerpop/blob/67764ba23d67d9f62048c22e8bbcefb87463584e/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPool.cs#L124]):
> {code:java}
> if (connection.IsOpen) return true;
> DefinitelyDestroyConnection(connection);
> {code}
> However, the connection stays in the pool as {{DefinitelyDestroyConnection}} 
> only disposes the connection:
> {code:java}
> private void DefinitelyDestroyConnection(Connection connection)
> {
>     connection.Dispose();
>     Interlocked.Decrement(ref _nrConnections);
> }
> {code}
> This is problematic as it can potentially fill the pool with unusable 
> connections. Even worse, {{SelectLeastUsedConnection}} will likely return 
> such an unusable connection since it only checks for the number of in-flight 
> requests and a disposed connection won't have any in-flight requests. This 
> means that {{GetConnectionFromPool}} will try to get a connection until 
> another still valid connection also has no in-flight requests.
> Note: This all can only happen when a connection was closed while sitting 
> idle in the pool which shouldn't usually happen due to the heartbeat. If a 
> connection problem occurs during the execution of a request, then all 
> connections will be closed and new ones will be created.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to