DB Tsai created SPARK-60989:
-------------------------------

             Summary: Populate configured user context on typed requests in 
Spark Connect Rust
                 Key: SPARK-60989
                 URL: https://issues.apache.org/jira/browse/SPARK-60989
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: DB Tsai
             Fix For: connect-rust-4.3.0


The Spark Connect Rust client can have a user ID configured through 
ChannelBuilder, but typed ExecutePlan and AnalyzePlan requests, including the 
initial request for reattachable execution, do not populate a missing or empty 
UserContext.user_id from that configuration. The configured identity can reach 
gRPC metadata while remaining absent from the protobuf request body.

To reproduce, configure a user ID on the channel, issue one of these typed 
requests with no UserContext or an empty user_id, and inspect the request 
received by a gRPC endpoint. The body should contain the configured user ID 
when the caller has not provided one.

The fix should:
* Populate missing user IDs on the affected typed execution and analysis 
requests before constructing the reattachable response stream.
* Preserve explicit caller-provided IDs, user names, and context extensions.
* Carry the effective execution context through ReattachExecute and 
ReleaseExecute, including cleanup after completion or an early stream drop.
* Leave raw serialized passthrough requests byte-exact, including unknown 
protobuf fields.

Artifact attribution is already handled on master by PR #164 through the shared 
upload_artifact_requests path; that behavior should be retained when rebasing. 
Broader client_type propagation is separate work.

Regression coverage should inspect actual protobuf requests at an in-memory 
gRPC endpoint for absent, empty, and explicit contexts; reattach and release 
identity; asynchronous cleanup; and unchanged raw passthrough bytes. Existing 
regression results on the proposal branch need to be refreshed after rebasing 
onto the current execution lifecycle.

Proposed fix and regression coverage by WindsorWZZ: 
https://github.com/apache/spark-connect-rust/pull/140
Related artifact attribution change: 
https://github.com/apache/spark-connect-rust/pull/164




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to