Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent result may be missed due to a race condition in MockMvc [SPR-16648] #21189

spring-projects-issues opened this issue Mar 27, 2018 · 0 comments
in: test status: backported type: bug


Copy link

spring-projects-issues commented Mar 27, 2018

Andy Wilkinson opened SPR-16648 and commented

From Rossen on the referenced Spring Boot issue:

The async value is set on MvcResult through an interceptor, and that releases perform(asyncDispatch(..)) to proceed. However there is a small window of time after that until the concurrentResult is set, see lines 316 vs 325. If you put a break on line 325 to slow down setting the concurrentResult, the main thread proceeds with the asyncDispatch and then hangs upon entering in the controller method.

It looks like at some point we did have a latch to wait for the dispatch, but that was removed in a follow-up fix. Not really sure how it went undetected for so long. Maybe the window is small enough, or perhaps something about this test that makes it a little more likely to fail.

I've been unable to reproduce the failure on macOS, but our Concourse CI environment (Docker container running on Linux) has been affected reasonably frequently, IIRC. That's the environment in which I captured the thread dump in the referenced Boot issue.

Affects: 4.3.14, 5.0.4

Reference URL: spring-projects/spring-boot#12609

Issue Links:

Referenced from: commits 6e4bbac, f9e6ea5

Backported to: 4.3.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: test status: backported type: bug
None yet

No branches or pull requests

2 participants