Repository navigation
Conversation
Prevent a blocked Java close from delaying unrelated owners through global cleanup queues. Preserve attachment accounting and retained ownership for failed-cleanup retry. Generated-by: OpenAI Codex
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
32b27ebpassed 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.