Repository navigation
fix(bindings/java): validate executor worker counts - #8439
Merged
Merged
Conversation
tisonkun
enabled auto-merge (squash)
October 29, 2026 17:40
suyanhanx
approved these changes
Oct 30, 2026
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.
Which issue does this PR close?
No linked issue.
Rationale for this change
AsyncExecutor.createTokioExecutor(0)reaches Tokio's worker-thread assertion and terminates the JVM through the JNI panic handler. A subprocess reproduction on the base revision exits with code 134 instead of throwing a Java exception. The native entry point also receives Java's signed 32-bitintas Rust's pointer-sizedusize.What changes are included in this PR?
jintand reject non-positive values withIllegalArgumentExceptionbefore converting tousizeor constructing the runtime.Integer.MIN_VALUE, then creates a valid executor and completes an in-memory write/read in the same JVM.Validation on macOS ARM64 with JDK 25: the new regression test fails before the fix and passes afterward;
./mvnw verifypasses all 26 executed tests, and Spotless, Rust formatting, and Clippy with warnings denied pass. External-service behavior suites were not configured. Other operating systems and JDK versions remain for CI validation.Are there any user-facing changes?
Zero and negative worker counts now throw
IllegalArgumentExceptionfromAsyncExecutor.createTokioExecutor.Breaking changes
AI Usage Statement
gemma4-26b,qwen3-8b, andqwen3.8-27b; reasoning-effort settings were not supplied. Role: supplied the initial executor-parameter finding; the JVM termination was independently reproduced against the Java binding.