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

AsyncServerResponse interoperability issue with path variables #26239

Closed
alexfeigin opened this issue Dec 8, 2020 · 7 comments
Closed

AsyncServerResponse interoperability issue with path variables #26239

alexfeigin opened this issue Dec 8, 2020 · 7 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@alexfeigin
Copy link

Affects: \5.3.2

There is an interoperability issue with the new AsyncServerResponse and routing functions. I tried to create a test in the webmvc project, but I'm afraid I don't know the framework well enough to reproduce it there.
Instead there is a reproduction using springboot, with all the latest greatest spring, and webmvc is managed to 5.3.2-snapshot.
spring-webmvc-interop-bug

when routing a request that has path variables, we get routed correctly, and get to a function that returns a ServerResponse.async response, but during the handling of the response, the routing function is called again, and we get an exception org.springframework.web.util.pattern.PatternParseException: Not allowed to capture 'pathVariable' twice in the same pattern

This does not happen if the response is a non async ServerResponse.

@alexfeigin
Copy link
Author

@poutsma
something changed in 5.3.2 snapshot of AsyncServerResponse (now DefaultAsyncServerResponse) that created the issue, and i'm pretty sure it wasn't the addition of block 😋

I just tested 5.3.2 snapshot to see the new block functionality in my tests, but something else is broken

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 8, 2020
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Dec 8, 2020
@jhoeller jhoeller added this to the 5.3.2 milestone Dec 8, 2020
poutsma added a commit to poutsma/spring-framework that referenced this issue Dec 8, 2020
This commit makes sure that the matching pattern attributes is cleared
when an async result has been obtained, so that the subsequent
dispatch starts from scratch.

Closes spring-projectsgh-26239
@poutsma poutsma closed this as completed in cb2b141 Dec 8, 2020
@poutsma
Copy link
Contributor

poutsma commented Dec 8, 2020

This should be fixed now.

When it has finished building, could you please try a recent snapshot and see if that solves it for you as well?
(We are under a bit of time pressure here, because 5.3.2 is scheduled to go out today)

@alexfeigin
Copy link
Author

alexfeigin commented Dec 8, 2020

Tested against latest snapshot, and my test works correctly, so from my prospective also seems fixed.

Thank you for the quick response!

poutsma added a commit that referenced this issue Dec 8, 2020
This commit refactors cb2b141 to move
the cleaning code from a DeferredResultProcessingInterceptor to the
RouterFunctionMapping.

See gh-26239
@alexfeigin
Copy link
Author

Tested again after this commit (snapshot build 84), everything still works fine.

@poutsma
Copy link
Contributor

poutsma commented Dec 8, 2020

Tested against latest snapshot, and my test works correctly, so from my prospective also seems fixed.

Thank you for the quick response!

Thank you for the quick test run!

I've refactored the code a bit in 2b77c08. It should do the same, but for extra reassurance: could you try a recent snapshot again, and report back?

Thank you for being so quick about this.

@alexfeigin
Copy link
Author

haha.. I refreshed the snapshot folder in maven waiting for the build to finish.. so I was ahead of you on that one

@poutsma
Copy link
Contributor

poutsma commented Dec 8, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants