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

Bug Report: Schedulers arent behaving as documented. #27

Open
nathanburrell opened this issue Sep 8, 2021 · 3 comments
Open

Bug Report: Schedulers arent behaving as documented. #27

nathanburrell opened this issue Sep 8, 2021 · 3 comments

Comments

@nathanburrell
Copy link

nathanburrell commented Sep 8, 2021

In the documentation of ReactorCallAdapterFactory it states that if you provide a scheduler it will modify the outcome of the request to be executed on a thread managed by the scheduler provided by using publishOn.

I would assume this functionality is added to provide a way for users to get off the netty response thread quickly after returning from webclient where you may potentially do blocking work on the netty response thread downstream as documented on https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html#webflux-concurrency-model

However in the code it doesnt use publishOn it uses subscribeOn ReactoryCallAdapter which I believe does nothing except moves the subscription to the schedulers thread, than executes the request and afterwards leaves the response to be handled on the netty thread incorrectly.

I believe this should be using publishOn as documented to move the response handling to a thread controlled by the scheduler provided.

@nathanburrell
Copy link
Author

This is actually in a dependency Ill move it there JakeWharton/retrofit2-reactor-adapter#16

@nathanburrell
Copy link
Author

nathanburrell commented Sep 9, 2021

@spencergibb can you reopen this issue as jakes comment on the adapter whilst it is documented incorrect is the solution, however they arent going to fix it in the adapter as its designed for okhttp and works fine but you suffer from this bug due to using netty/webclient so will need to add support for publishOn.

@spencergibb spencergibb reopened this Sep 9, 2021
@spencergibb
Copy link
Contributor

PRs welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants