You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Eduard Ordukhanov (Jira)" <ji...@apache.org> on 2020/03/03 20:39:00 UTC

[jira] [Comment Edited] (TINKERPOP-2288) Get ConnectionPoolBusyException and then ServerUnavailableExceptions

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

Eduard Ordukhanov edited comment on TINKERPOP-2288 at 3/3/20 8:38 PM:
----------------------------------------------------------------------

Is it possible for a connection to close while there are still requests in flight?
 If thats a possibility then in the following code snippet it seems like "ReceiveMessagesAsync" is never called, and therefore requests in flight are never decremented.
{code:java}
private void BeginReceiving()
{
  var state = Volatile.Read(ref _connectionState);
  if (state == Closed) return;
  ReceiveMessagesAsync().Forget();
}{code}
If this can happen then it seems like in the following code snippet, the line

"if (connection.NrRequestsInFlight >= _maxInProcessPerConnection) continue;"

will always get executed, and the program will never reach the next line to remove the connection from the pool in the following code block from the "TryGetAvailableConnection" function.

 

 
{code:java}
if (!connection.IsOpen)
{
  RemoveConnectionFromPool(connection);
  continue;
}
{code}
 

I'm probably missing something, so I hope someone else can confirm whether or not this can happen.

Thanks!


was (Author: edordukh):
Is it possible for a connection to close while there are still requests in flight?
If thats a possibility then in the following code snippet it seems like "ReceiveMessagesAsync" is never called, and therefore requests in flight are never decremented.


{code:java}
private void BeginReceiving()
{
  var state = Volatile.Read(ref _connectionState);
  if (state == Closed) return;
  ReceiveMessagesAsync().Forget();
}
{code}

> Get ConnectionPoolBusyException and then ServerUnavailableExceptions
> --------------------------------------------------------------------
>
>                 Key: TINKERPOP-2288
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2288
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: dotnet
>    Affects Versions: 3.4.1
>         Environment: Gremlin.Net 3.4.1
> Microsoft.NetCore.App 2.2
> Azure Cosmos DB
>            Reporter: patrice huot
>            Priority: Critical
>
> I am using .Net core Gremlin API  query Cosmos DB.
> From time to time we are getting an error saying that no connection is available and then the server become unavailable. When this is occurring we need to restart the server. It looks like the connections are not released properly and become unavailable forever.
> We have configured the pool size to 50 and the MaxInProcessPerConnection to 32 (Which I guess should be sufficient).
> To diagnose the issue, Is there a way to access diagnostic information on the connection pool in order to know how many connections are open and how many processes are running in each connection?
> I would like to be able to monitor the connections usage to see if they are about to be exhausted and to see if the number of used connections is always increasing or of the connection lease is release when the queries completes?
> As a work around, Is there a way we can access this information from the code so that I can catch those scenario and create logic that re-initiate the connection pool?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)