[#14044] Strengthen coroutine lifecycle regression#14047
Open
cj848 wants to merge 1 commit into
Open
Conversation
|
|
Contributor
Author
|
Closing this follow-up to keep the upstream change represented by the already merged #14046. The behavioral test refinement will not be proposed as a separate PR. |
|
cj848
marked this pull request as ready for review
July 22, 2026 08:00
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.



Why
Follow-up to #14046. The original unit test verifies the block-aware callback contract, but reverting the production change fails at the interface assertion before exercising the stale-current-trace behavior.
This revision keeps both callback contracts executable in the test and models the lifecycle observed around coroutine/Reactor nesting:
before()starts trace A, a simulated nested callback clears the async context's current trace, andafter()must still close the exact block from trace A.Related to #14044.
What
ResumeWithInterceptor.before()andafter().AroundInterceptoror fixedBlockAroundInterceptorcallback contract from the same test source.currentAsyncTraceObject()lookup and preserve exact block identity plus enter/begin/leave/close ordering.Regression proof
ResumeWithInterceptorTestfails becauseAsyncContextSpanEventSimpleAroundInterceptor.after()callscurrentAsyncTraceObject()after it has been cleared.before().Verification
./mvnw -q -pl agent-module/plugins/kotlin-coroutines -am -DskipITs -Dtest=ResumeWithInterceptorTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -q -pl agent-module/plugins/kotlin-coroutines -am -DskipITs testCoroutines_1_6_IT: 38 tests, 0 failures/errors/skipsgit diff --check