Mirror Spring Framework #37159 for JAIPilot Cloud - #1
Open
skrcode wants to merge 1 commit into
Open
Conversation
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>
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.
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.