Repository navigation
feat(csharp): add proposed change for Thrift library supports of interleaved async calls - #99
Draft
birschick-bq wants to merge 20 commits into
Draft
birschick-bq wants to merge 20 commits into
birschick-bq wants to merge 20 commits into
Conversation
This reverts commit d648939.
4 of 5 tasks
Collaborator
|
Neat! The autogenerated files have been edited for multiple reasons; a key one is performance. So I don't think we can get away from hand-editing entirely (e.g. to load Arrow arrays directly), but we could look at changing the stock Thrift compiler to accommodate some of our other quirks. |
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 22, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management.
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 23, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management.
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 24, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management.
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 24, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 24, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 24, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 24, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 24, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 25, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 25, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 25, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT 5.6 Luna Co-authored-by: GPT-6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 25, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT-5.6 Luna Co-authored-by: GPT-6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
birschick-bq
pushed a commit
to birschick-bq/thrift
that referenced
this pull request
Sep 25, 2026
Client: netstd Handles - [THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception](https://issues.apache.org/jira/browse/THRIFT-5830) This pull request introduces a new per-call transport mechanism for `THttpTransport`, allowing each logical Thrift call to use a distinct HTTP request/response cycle. This improves resource management, error isolation, and concurrency for HTTP-based Thrift clients. The implementation includes a new interface, a per-call transport class, and comprehensive tests to verify correct behavior and resource disposal. Proposed changes to the code generator can be found in this PR: [feat(csharp): add proposed change for Thrift library supports of interleaved async calls](adbc-drivers/hiveserver2#99 (comment)) * Added the `ITPerCallTransportProvider` interface to define a standard method for creating per-call transports. (`lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs`) * Implemented `THttpPerCallTransport`, a new internal class that manages request/response streams for a single Thrift call, ensuring proper disposal and isolation from the parent transport. (`lib/netstd/Thrift/Transport/Client/THttpPerCallTransport.cs`) * Updated `THttpTransport` to implement `ITPerCallTransportProvider` and provide the `CreatePerCallTransportAsync` method, which returns a new `THttpPerCallTransport` for each call. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) [[1]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeL35-R35) [[2]](diffhunk://#diff-f12dc2850124c3b5b76d6d80850c70e79d0b6735f7c701ba23b2dfac2e8f1cfeR301-R373) * Added an internal `SendAsync` method to `THttpTransport` to handle sending the request stream and returning the HTTP response, with robust exception handling and resource cleanup. (`lib/netstd/Thrift/Transport/Client/THttpTransport.cs`) * Added comprehensive unit tests to `THttpTransportTests` to verify per-call transport behavior, including resource disposal, error handling, concurrency, and protocol factory integration. (`lib/netstd/Tests/Thrift.Tests/Transports/THttpTransportTests.cs`) These changes collectively improve the reliability, testability, and scalability of HTTP-based Thrift transports by supporting per-call isolation and robust resource management. Co-authored-by: Claude Sonnet 5 Co-authored-by: GPT-5.6 Luna Co-authored-by: GPT-6 Luna Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
This change is a WIP that demonstrates how to use the changes proposed in THRIFT-5830: THttpTransport can now be used in interleaved async calls- #3930. This is to resolve the issue raised in THRIFT-5830: Using THttpTransport using interleaved asynchronous calls may throw exception
As the code in TCLIService was originally generated - we must decide if we want the manual updates I am proposing here - or wait for the generator to produce a compatible solution.
This pull request adds a comprehensive new test class for the
TCLIService.Clientin the HiveServer2 Thrift driver. The tests cover protocol factory behavior, transport management, and legacy constructor compatibility, ensuring robust client interactions and resource handling.New Test Coverage for Thrift Client
TCLIServiceClientTestsclass inTCLIServiceClientTests.cswith multiple[Fact]tests to verify the behavior ofTCLIService.Clientregarding protocol factory usage, transport lifecycle, and legacy constructor support.Protocol and Transport Management
Legacy Constructor Support
Test Utilities
TrackingProtocolFactoryandSharedTransporthelper classes to facilitate protocol and transport tracking within the tests.Reviewers: recommend to hide whitespace changes as it was reformatted to use standard 4-space indentation.