Skip to content

Mirror Spring Framework #37159 for JAIPilot Cloud - #1

Open
skrcode wants to merge 1 commit into
jaipilot-demo/spring-37159-basefrom
jaipilot-demo/spring-37159
Open

Mirror Spring Framework #37159 for JAIPilot Cloud#1
skrcode wants to merge 1 commit into
jaipilot-demo/spring-37159-basefrom
jaipilot-demo/spring-37159

Conversation

@skrcode

@skrcode skrcode commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Exact mirror of spring-projects#37159 for a JAIPilot Cloud evaluation.

Base: 8904790
Head: 7e53799

Do not merge this mirror. Any accepted JAIPilot result will be a draft companion targeting this exact head.

LockSupport.park() can return without resume() having set the parked
thread reference to READY, either spuriously or when the thread is
interrupted. The reference then still points to the current thread,
so the compareAndSet in the await() loop can never succeed again and
the loop neither parks nor exits, spinning on CPU until the upstream
emits the next signal.

On virtual threads this is particularly harmful since a spinning
thread never yields its carrier. Once as many requests spin as there
are carrier threads, unrelated virtual thread tasks are no longer
scheduled. The interrupt case is reachable through Spring MVC async
request handling, where both a timeout and a client disconnect cancel
the task with interruption.

Park again when the reference is still owned by the current thread
after a spurious wakeup. On interruption, restore the interrupt
status, clear the reference, and propagate the cancellation as an
InterruptedIOException, unless data has arrived concurrently, in
which case the data is delivered first and the interrupt status is
preserved for the next call. The read() methods rethrow IOExceptions
as-is instead of wrapping them, so the interruption surfaces as a
regular IOException to callers.

Closes spring-projectsgh-37159

Signed-off-by: donggyu <donggyu@flex.team>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants