You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "vkagamlyk (via GitHub)" <gi...@apache.org> on 2023/05/09 16:37:25 UTC

[GitHub] [tinkerpop] vkagamlyk commented on a diff in pull request #2058: TINKERPOP-2944 Dispose Cancellation callbacks to fix memory leak

vkagamlyk commented on code in PR #2058:
URL: https://github.com/apache/tinkerpop/pull/2058#discussion_r1188864810


##########
gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs:
##########
@@ -175,6 +175,7 @@ private void HandleReceivedMessage(ResponseMessage<List<object>> receivedMsg)
             {
                 responseHandler?.Finalize(status.Attributes);
                 _callbackByRequestId.TryRemove(receivedMsg.RequestId.Value, out _);
+                _cancellationByRequestId.TryRemove(receivedMsg.RequestId.Value, out _);

Review Comment:
   maybe it's better to move clearing of `_cancellationByRequestId` 2 lines higher to avoid leak when `responseHandler?.Finalize` failed?



-- 
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