Repository navigation
fix(runtime): round 45 runtime and JNI findings - #543
Merged
Merged
Conversation
- Legacy direct-write tail (dispatch_into, vespera_dispatch_into, dispatchDirect0) refuses a text/event-stream response with a bounded 500 instead of draining a stream that may never end; the body is not polled. Documented in vespera.h, dispatch_into and the ffi docs. - inline_only_serde! reads its object through a duplicate-rejecting visitor again (Operation, MediaType, Encoding, Parameter, Header, Example, RequestBody, Response, SecurityScheme): a repeated key is "duplicate field" as the derive reports it; accepted input is unchanged. - A $ref key in a callback map is refused (bare, with siblings, string or object value) instead of loading as an empty Path Item. - Multipart part-name echo escapes the Arabic letter mark, Mongolian vowel separator, word joiner, BOM and the other Cf format controls; the module doc no longer claims zero dependencies. - Resumable DIRECT dispatch into an undersized out buffer zeroes the stash handle area like the error-wire path. - Comment fix: header_value_from_owner's non-ASCII Latin-1 path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ey paths The duplicate-key check is a plain contains_key + insert, so the arm lines that the match on Entry left uncovered in CI's collapsed layout are gone. expecting is executed through a type-mismatch error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Round 45 runtime / core / JNI findings
Fixed
finish_direct_write(behinddispatch_into,dispatch_into_async(_borrowed),vespera_dispatch_intoand JNIdispatchDirect0) now answers atext/event-streamresponse (any status) with a bounded500wire (EVENT_STREAM_LEGACY_MSG) without polling its body. This also removes the 422 prefetch wait for an SSE body. Trade-off: a finite SSE that used to fit the caller's buffer is now refused on the legacy API; the resumable tail (dispatch_into_async_borrowed_resumable, DirectStash, streaming modes) is unchanged. Documented invespera.h(vespera_dispatch_into), thedispatch_into_async/dispatch_into_async_borroweddocs and theffidoc. Note for the docs fixer: the AGENTS.md C ABI row is not touched here.legacy_event_stream_is_refused_without_draining(plain and with parameters) andlegacy_event_stream_422_is_refused_without_the_prefetch, both over never-ending bodies under a 5 s timeout (they hang without the fix).inline_only_serde!buffered intoserde_json::Value, whose map insert keeps the last duplicate. It now buffers throughStrictValue, a visitor that errorsduplicate fieldat every depth, returns the sameValueotherwise. Covers Operation, MediaType, Encoding, Parameter, Header, Example, RequestBody, Response and SecurityScheme.inline_only_types_refuse_a_repeated_key(nine types plus a nested duplicate),strict_value_matches_serde_json_value,strict_value_takes_every_visitor_method,strict_value_refuses_a_nested_repeated_key.$refin a callback map read as an expression.skip_callback_extension_keys(used byOperation::callbacksandComponents::callbacks) refuses a$refkey, bare, with siblings, string or object value, with the Callback-flavoured Reference Object error.callback_reference_key_is_refused_on_load(three cases).needs_escapenow escapes the Cf / Zl / Zp characters that reorder, hide or join text: soft hyphen, U+0600..0605, U+061C, U+06DD, U+070F, U+0890/0891, U+08E2, U+180E, U+2028..202E, U+2060..206F, U+FEFF, U+FFF9..FFFB, the musical and tag controls. The list is hand-written (no table dependency); it does not enumerate every Cf code point of every Unicode version.reflected_field_name_is_bounded_and_printablecases (ALM, MVS, word joiner / invisible plus, BOM / interlinear anchor, soft hyphen / tag character).multipart/mod.rsno longer says "zero-dependency".dispatch_resumable(dispatchResumable0) zeroes the handle area (min(len, 9) bytes) on the undersized-buffer answer, likewrite_error_to_out. Test extendsresumable_dispatch_never_reruns_a_handler(1023-byte and 4-byte buffers).dispatch.rscomments that saidheader_value_from_ownerfalls back tofrom_strnow describe the Latin-1 path for non-ASCII values.Refuted / not changed
ThrowNew(VesperaStreamAbortedException, msg), which has no cause parameter. Attaching the captured cause needs one of: (a)NewObjectof a(String, Throwable)constructor, or (b)ThrowNewfollowed byexception_occurred→ clear →call_method(initCause)→Throw. Both are outside whatNativeImageMetadataTestaccepts: itseveryJniLookupCallSiteIsCoveredByAnExtractionRuleallows onlyfind_class,get_method_id,throw_newandcall_method, sonew_objectandthrowfail the test unless the extraction rules change. The fix also has to carry the capturedThrowable(aGlobal) from the Tokio worker's closures (push, header consumer, pull) to the outer symbol throughStreamingFlags, at five abort sites, and it would need a demo-app E2E test. CallinginitCausewhile the abort is still pending is not allowed under JNI's pending-exception rules, so the cause cannot be attached in place. The recipe is ready if the owners accept an extraction rule forEnv::throwinNativeImageMetadataTest(a follow-up); this round's scope excludes that test file.Not changed (also for the record)
dispatch_intostill drains a non-SSE body of unknown length to count its size, bounded bymax_buffered_response_bytesin bytes, not in time; that is the legacy API's documented contract.Verification
cargo fmt --all -- --checkclean.cargo clippy -p {vespera_core,vespera_inprocess,vespera_jni,vespera} --all-targets --all-features -- -D warningsclean.cargo test:vespera_core(all),vespera(lib,validated_extractor,jni_validation),vespera_inprocess --all-features(all targets),vespera_jni --lib(59).jni-config.jsonand the Java sources are unchanged, so the bridge and E2E suites were not run..changepacks/changepack_log_runtime_round45.jsonlists the seven packages at Patch.🤖 Generated with Claude Code