Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

HackPoint
Copy link

@HackPoint HackPoint commented May 5, 2025

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?

  • Middleware enhancements supporting complete metadata header propagation.
  • Middleware lifecycle hooks for better request/response management.
  • Comprehensive integration tests validating middleware functionality.
  • Documentation updates reflecting middleware improvements.

Key Features

  • Complete Header Propagation: Ensures accurate propagation of gRPC metadata headers throughout middleware lifecycle events.
  • HTTP/HTTPS Handling: Supports middleware integration and metadata propagation for HTTP and HTTPS communications.
  • Middleware Lifecycle Management: Supports reliable middleware hooks (OnBeforeSendingHeaders, OnHeadersReceived, OnCallCompleted).
  • Enhanced Testing: Adds comprehensive integration tests to verify correct middleware behavior.

Impact

  • Improves middleware reliability and simplifies debugging.
  • Enhances transparency in gRPC and HTTP/S communication within Flight-based applications.

Are These Changes Tested?

Testing Overview

Unit Tests:

  • Added tests for middleware lifecycle event execution (e.g., OnBeforeSendingHeaders, OnHeadersReceived, OnCallCompleted).
  • Verified internal logic for capturing and storing gRPC metadata headers.

Integration Tests:

  • Tested end-to-end with a real Flight client and in-memory server setup.
  • Validated propagation of custom headers (e.g., x-server-header, Set-Cookie) between client and server.

End-to-End Tests:

  • Simulated real-world Flight requests to ensure headers are processed consistently across middleware layers.
  • Confirmed correct invocation order and middleware behavior under different server responses.

Example Test Cases:

  • Verify that OnHeadersReceived correctly captures server-sent headers.
  • Ensure custom client middleware modifies request headers as expected.
  • Validate that OnCallCompleted is triggered on both success and error cases.

Checklist

  • Implementation completed
  • Tests added and passing

HackPoint and others added 5 commits April 15, 2025 19:11
…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.
@HackPoint HackPoint requested a review from CurtHagenlocher as a code owner May 5, 2025 09:44
Copy link

github-actions bot commented May 5, 2025

⚠️ GitHub issue #46315 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants