Add spring-core regression test for gh-37159 SubscriberInputStream interrupt fix - #2
Draft
jaipilot[bot] wants to merge 1 commit into
Draft
Conversation
…rInputStream interrupt fix
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.
Context: This is a JAIPilot Cloud companion evaluated against skrcode/spring-framework PR #1, an exact mirror of spring-projects#37159 ("Fix busy-spin in SubscriberInputStream await()"). The base commit already contains the production fix in both near-duplicate classes:
spring-core/.../io/buffer/SubscriberInputStreamandspring-web/.../http/client/SubscriberInputStream.What changed: Added
inputStreamSubscriberInterruptWhileAwaitingData()tospring-core'sDataBufferUtilsTests, testing the same interrupt-while-parked contract that spring-web'sSubscriberInputStreamTests.interruptWhileAwaitingData()already covers, but through spring-core's publicDataBufferUtils.subscriberInputStream(Publisher, int)entry point. No production code was modified.Why: The original PR fixed the identical bug in two independently-maintained near-duplicate classes but only added a regression test for one of them (spring-web). The spring-core copy — used internally by the public
DataBufferUtils.subscriberInputStreamAPI — had zero prior test coverage for this scenario, leaving the busy-spin/interrupt fix unverified on that path.Behavior preserved: The reader thread parks (
Thread.State.WAITING) while awaiting data; on interruption,read()throwsInterruptedIOException("Interrupted while awaiting data"), the thread terminates promptly, and the interrupt status is restored on the caller — identical contract to the already-tested spring-web class.Cleanup / performance / modernization: Evaluated and found already satisfied or not applicable — see the
measurements.passesdetail for the specific hypotheses considered (duplicate catch-block extraction, the required extra volatile read inawait()) and why each was rejected as unsafe or of no proven benefit within this bounded scope. No build, dependency, or JDK path was touched by the original PR, so modernization is out of scope.Verification:
behavior_baselineandbehavior_candidateuse the identical focused Gradle command and both pass (402 spring-core + 6 spring-web tests, 0 failures).full_build(:spring-core:check :spring-web:check) passes with 9057 tests across both modules, 0 failures/errors.Limitations: No JMH/microbenchmark evidence was produced for the busy-spin fix itself (it is the original PR's own change, not this companion's); the deterministic
Thread.State.WAITINGobservation in both tests is used as evidence that the fix is effective, per the performance-mode guidance preferring deterministic operation-count-style evidence over noisy timing for this kind of scheduling fix.Generated by JAIPilot Cloud for #1 from Anthropic session
sesn_0157PGf51tDeHBUB1UGBVTRD.