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

WebClient retry() doesn't re-run filters #23909

Closed
Anusien opened this issue Nov 1, 2019 · 4 comments
Closed

WebClient retry() doesn't re-run filters #23909

Anusien opened this issue Nov 1, 2019 · 4 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement
Milestone

Comments

@Anusien
Copy link

Anusien commented Nov 1, 2019

Calling retry() on a Mono<> produced by calling WebClient.exchange() won't re-run the filters. This means any modifications made to the request by filters (like changing the URL for load-balancing purposes) won't be repeated.

DefaultWebClient seems to run all the filters synchronously, including generating the URL. Then DefaultExchangeFunction calls ClientHttpConnection. It's the http connection that does the actual connection asnychronously, producing a Mono<>. Specifically, filters get run when you call exchange() or retrieve(), not when you actually subscribe.

Related: spring-cloud/spring-cloud-commons#579

@Anusien Anusien changed the title WebClient retry() doesn't run filters WebClient retry() doesn't re-run filters Nov 1, 2019
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 1, 2019
@rstoyanchev
Copy link
Contributor

It looks like this might be a duplicate of #22375 which was fixed in 5.2 but was not backported to 5.1.x. We should backport that fix in any case, but can you confirm the version of the Spring Framework you are on just to be sure?

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 4, 2019
@rstoyanchev rstoyanchev added this to the 5.1.12 milestone Nov 4, 2019
@rstoyanchev rstoyanchev self-assigned this Nov 4, 2019
@Anusien
Copy link
Author

Anusien commented Nov 4, 2019

org.springframework:spring-webflux:5.1.7.RELEASE

@rstoyanchev
Copy link
Contributor

Okay, you shouldn't experience the issue with 5.2.1 if you want to try and confirm. I've scheduled this to backport the same fix to 5.1.12.

rstoyanchev added a commit that referenced this issue Nov 6, 2019
Previously fixed in 5.2 via d46359. Now also backported to 5.1.x.

Closes gh-23909
@spring-projects-issues
Copy link
Collaborator

Fixed via 1a05765

@jhoeller jhoeller added the type: backport An issue that is a backport of another issue to a maintenance branch label Nov 7, 2019
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: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants