Copilot commented on code in PR #3930:
URL: https://github.com/apache/thrift/pull/3930#discussion_r4098940968


##########
lib/netstd/Thrift/Transport/Client/THttpTransport.cs:
##########
@@ -293,10 +354,152 @@ protected override void Dispose(bool disposing)
                 {
                     _inputStream?.Dispose();
                     _outputStream?.Dispose();
+                    _response?.Dispose();
+                    _response = null;
+                    _responseReadTimeout?.Dispose();
+                    _responseReadTimeout = null;
                     _httpClient?.Dispose();
                 }
             }
             _isDisposed = true;
         }
+
+        public ValueTask<TTransport> 
CreatePerCallTransportAsync(CancellationToken cancellationToken = default)
+        {
+            return new ValueTask<TTransport>(new THttpPerCallTransport(this));
+        }

Review Comment:
   This method accepts a cancellation token but never observes it, so an 
already-canceled per-call setup still returns a usable transport and generated 
call setup can proceed until a later write/read checks cancellation. This is 
inconsistent with `THttpTransport.OpenAsync`, which checks its token even 
though it has no asynchronous work; call 
`cancellationToken.ThrowIfCancellationRequested()` before constructing the 
transport.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to