haoyangeng-db opened a new pull request, #57638:
URL: https://github.com/apache/spark/pull/57638

   ### What changes were proposed in this pull request?
   
   `SparkConnectGetStatusHandler` collects response extensions from every 
registered `GetStatusPlugin` and adds them to the response with 
`GetStatusResponse.Builder.addExtensions` / 
`OperationStatus.Builder.addExtensions`. Those protobuf builder methods reject 
`null`, so a plugin that returns a list containing a `null` element makes the 
whole `GetStatus` RPC fail with a NullPointerException that escapes the 
per-plugin `try`/`catch` isolation.
   
   This filters `null` elements out inside that isolation boundary, at both the 
request level and the operation level, so one misbehaving plugin can no longer 
break the RPC for everyone.
   
   ### Why are the changes needed?
   
   The handler already goes to some length to isolate plugin failures: each 
plugin call is wrapped in `try`/`catch NonFatal`, and a throwing plugin is 
logged and skipped so healthy plugins still contribute. A `null` list element 
defeats that, because the NullPointerException is raised later by the builder, 
outside the `try` block, and fails the request. Plugins are third-party 
extension points, so the handler should not assume their returned lists are 
null-free.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. With well-behaved plugins the behavior is unchanged; only the failure 
mode for a plugin returning a null element changes, from a failed RPC to that 
element being dropped.
   
   ### How was this patch tested?
   
   Added `GetStatusHandlerSuite."GetStatus filters null extension elements 
returned by a plugin"`, which registers a plugin returning a single-null list 
alongside a healthy echo plugin and asserts the null is dropped while the 
healthy plugin's extension survives, at both the request and operation levels.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Co-authored by Claude Code.
   


-- 
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]


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

Reply via email to