-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-46315 [C#] Apache Arrow Flight Middleware #46316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ing headers and cookie values - Implemented tests verifying that CookieMiddleware correctly captures and persists values from both headers and cookies. - Added CapturingCookieMiddleware and CapturingCookieMiddlewareFactory for validating middleware lifecycle. - Ensured middleware correctly processes cookie strings and validates persistence throughout the request lifecycle.
…s it will add up and force more GC calls)
|
|
…nto feat/flight-csharp-middleware # Conflicts: # csharp/Directory.Build.props # csharp/src/Apache.Arrow.Flight/Middleware/ClientCookieMiddleware.cs # csharp/src/Apache.Arrow.Flight/Middleware/ClientCookieMiddlewareFactory.cs # csharp/src/Apache.Arrow.Flight/Middleware/CookieManager.cs # csharp/src/Apache.Arrow.Flight/Middleware/Extensions/FlightMethodParser.cs # csharp/src/Apache.Arrow.Flight/Middleware/Extensions/StatusUtils.cs # csharp/src/Apache.Arrow.Flight/Middleware/Interceptors/ClientInterceptorAdapter.cs # csharp/test/Apache.Arrow.Flight.Tests/MiddlewareTests/ClientCookieMiddlewareTests.cs # csharp/test/Apache.Arrow.Flight.Tests/MiddlewareTests/Stubs/ClientCookieMiddlewareMock.cs
…r for cookie middleware - Remove unused and redundant files
|
@HackPoint can you please rebase this change now that the other change is checked-in? |
Alternatively, is it okay if we fork the C# implementation to a separate repo now? Rebasing this change might be complicated enough that we get no real benefit from continuing to use the same repo and this change is the last "pending" one before the proposed fork. |
Than what's your preferred thing to do? Should I continue with merge and rebase or not? |
Merge and rebase is fine; I wasn't sure if you were working on this. |
Sir, I was so glad that you merged the pr , I started the moment you have mentioned this rebase. I almost done and started testing it against our db. The moment I will finish, I'll push the update. |
…ddleware # Conflicts: # csharp/src/Apache.Arrow.Flight.Sql/Client/FlightSqlClient.cs # csharp/src/Apache.Arrow.Flight.Sql/DoPutResult.cs # csharp/src/Apache.Arrow.Flight.Sql/PreparedStatement.cs # csharp/src/Apache.Arrow.Flight.Sql/SqlActions.cs # csharp/src/Apache.Arrow.Flight.Sql/Transaction.cs # csharp/test/Apache.Arrow.Flight.Sql.Tests/FlightSqlClientTests.cs
|
@CurtHagenlocher Hi sir, it's completed and all the integration has been done and tested. Please merge it it should be working fine. |
|
CurtHagenlocher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I left some feedback and some questions.
csharp/src/Apache.Arrow.Flight/Middleware/ClientCookieMiddlewareFactory.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/ClientCookieMiddleware.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/ClientCookieMiddlewareFactory.cs
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/ClientCookieMiddlewareFactory.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/Interceptors/ClientInterceptorAdapter.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/Interceptors/ClientInterceptorAdapter.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/Interceptors/ClientInterceptorAdapter.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/Interceptors/ClientInterceptorAdapter.cs
Outdated
Show resolved
Hide resolved
csharp/src/Apache.Arrow.Flight/Middleware/Interceptors/ClientInterceptorAdapter.cs
Outdated
Show resolved
Hide resolved
…iddleware handling - Switched to file-scoped namespace style for consistency - Ensured exceptions from ResponseHeadersAsync are explicitly propagated - Lifted CallHeaders allocation out of loop to avoid redundant allocations - Captured getStatus() and getTrailers() once per call instead of per-middleware - Fixed double invocation of OnCallCompleted when a middleware throws - Extracted NotifyCompletionOnce as a private helper to keep HandleResponse DRY - Preserved behavior while ensuring OnCallCompleted is invoked at most once
|
The dotnet implementation was moved to https://github.com/apache/arrow-dotnet |
|
Superceded by apache/arrow-dotnet#139. |
Hi Curt, what does it means? Did you merged the Middleware into the c# code ? |
Not yet, I ported your PR to the new repository for the C# implementation. I want to make sure the tests are still passing, and it's been long enough that I'll take another look at it before committing. |
Sure, if you need me to fix something or help just tell me. And can you please say, why I'm unable to see myself as contributor? |
|
I tried to change the commit message a few different ways but nothing I did made you show as a contributor. Feel free to submit a new PR to this repo if you like and then I'll close mine. (If you do this, consider starting with what's in my branch as I've fixed a bunch of lint issues.) |
I will fork your PR and re-push it. Starting immediately on it. |
Enhancement: Apache Arrow Flight Middleware in C#
Overview
This Pull Request enhances middleware support for Apache Arrow Flight using C#, focusing on improved metadata header management and propagation for better observability and extensibility. It also provides handling for HTTP/HTTPS communication.
Rationale for this Change
Effective middleware is critical for managing metadata headers, ensuring accurate request/response handling, and simplifying debugging in distributed systems. By improving middleware capabilities, we enhance reliability and observability, significantly benefiting developers and operational teams managing complex Flight-based applications.
What's Included in this PR?
Key Features
OnBeforeSendingHeaders,OnHeadersReceived,OnCallCompleted).Impact
Are These Changes Tested?
Testing Overview
Unit Tests:
OnBeforeSendingHeaders,OnHeadersReceived,OnCallCompleted).Integration Tests:
x-server-header,Set-Cookie) between client and server.End-to-End Tests:
Example Test Cases:
OnHeadersReceivedcorrectly captures server-sent headers.OnCallCompletedis triggered on both success and error cases.Checklist