dbtsai opened a new pull request, #902: URL: https://github.com/apache/spark-connect-rust/pull/902
### What changes were proposed in this pull request? A stalled Java query or session close currently blocks every later close of the same type through a process-wide JNI cleanup queue. Those unrelated owners retain their handles and admission permits while waiting. Give each query and session its own cleanup worker, using the existing attachment, detach and shutdown accounting. Failed dispatch and cleanup retain ownership for explicit retry. Task cancellation and task frees continue to share their existing worker. Each query/session close now costs a thread spawn and, during normal cleanup, a JNI attach/detach instead of shared-worker burst reuse. If a closer cannot start, its handles and permits remain retained until an explicit server close retries cleanup. Blocked owners remain bounded by per-engine admission; threads and attachments finishing completed closes can overlap later admission. Follow-up to #474. ### Why are the changes needed? Prevent an indefinitely blocked close from delaying unrelated queries and sessions in this experimental server. ### Does this PR introduce _any_ user-facing change? Yes. Unrelated query/session cleanup can now reclaim admission while a peer close remains blocked. ### How was this patch tested? Validation rerun for this follow-up on macOS ARM64 with JDK 21 and the pinned Spark 4.2.0-SNAPSHOT runtime: JNI Rust tests, workspace formatting/Clippy, license freshness, the release native build and real JNI smoke under `-Xcheck:jni`. Earlier in this follow-up, the client, frontend and C sources at base `32b27eb` passed the following checks; these were not repeated after the JNI-only review fixes: frontend Rust tests, release client unit tests, full integration compilation with and without WASM, and C ownership checks with ASan/UBSan. Hosted CI remains pending. Added Rust regressions cover blocked-owner isolation across engines and closer-start failure with retry using injected blocking/failures. The real JVM smoke covers normal closes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-6) This pull request and its description were written by OpenAI Codex. -- 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]
