[
https://issues.apache.org/jira/browse/TINKERPOP-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16521042#comment-16521042
]
ASF GitHub Bot commented on TINKERPOP-1978:
-------------------------------------------
GitHub user FlorianHockmann opened a pull request:
https://github.com/apache/tinkerpop/pull/885
Add check for connection state before returning it TINKERPOP-1978
https://issues.apache.org/jira/browse/TINKERPOP-1978
This PR simply adds the requested check of whether a connection is actually
open that was returned from the pool before returning it to the driver. Before
it was possible that a connection would be used that was already closed while
it was in the connection pool.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1978
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/885.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #885
----
commit c4a254726167d798617331ff3dd00ece97377b2d
Author: Florian Hockmann <fh@...>
Date: 2018-06-23T10:24:15Z
Add check for connection state before returning it TINKERPOP-1978
----
> Check for Websocket connection state when retrieved from Connection Pool
> missing
> --------------------------------------------------------------------------------
>
> Key: TINKERPOP-1978
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1978
> Project: TinkerPop
> Issue Type: Bug
> Components: dotnet
> Affects Versions: 3.3.3
> Reporter: Jamilu Abubakar
> Assignee: Florian Hockmann
> Priority: Major
>
> When retrieving a connection from the connection pool there is no check to
> see what the current connection state of the websocket is before it is used.
> This means that if the websocket were to be closed because the server
> recycled or the connection was aborted by the server since it was last used
> and its Send method were to be called the following exception would be thrown:
> {quote}Error during execution ExecuteJObjectQueryAsync method. Exception:
> System.Net.Http.WinHttpException (0x80072EFF): The connection with the server
> was terminated abnormally
> at System.Net.WebSockets.WinHttpWebSocket.SendAsync(ArraySegment`1 buffer,
> WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken
> cancellationToken)
> at System.Net.WebSockets.WebSocketHandle.SendAsync(ArraySegment`1 buffer,
> WebSocketMessageType messageType, Boolean endOfMessage, CancellationToken
> cancellationToken)
> at Gremlin.Net.Driver.WebSocketConnection.<SendMessageAsync>d__5.MoveNext()
> {quote}
>
> Please add check the Websocket state before use, handle exceptions due to
> closed or aborted connections and ideally have an extensible retry handler.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)