Copilot commented on code in PR #3930:
URL: https://github.com/apache/thrift/pull/3930#discussion_r4108907996
##########
lib/netstd/Thrift/Transport/Client/THttpTransport.cs:
##########
@@ -123,22 +131,36 @@ public override Task OpenAsync(CancellationToken
cancellationToken)
public override void Close()
{
- if (_inputStream != null)
+ List<THttpPerCallTransport> transports;
+ CancellationTokenSource lifecycleCancellation;
+ lock (_lifecycleLock)
{
- _inputStream.Dispose();
- _inputStream = null;
- }
+ _lifecycleOpen = false;
Review Comment:
`Close()` now marks the lifecycle closed and all I/O paths reject further
use, but `IsOpen` still unconditionally returns `true`. Callers will therefore
observe a closed/disposed HTTP transport as open (including
`TBaseClient.OpenTransportAsync`'s state check). Make `IsOpen` reflect the
lifecycle state and add a close-state assertion.
--
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]