-
Notifications
You must be signed in to change notification settings - Fork 656
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
The sequence for acquiring the connection was not cancelled after the request ended. #3531
Comments
Perhaps we could register a cancel callback using sink.onCancel(Subscription::cancel) during onSubscribe? |
@qnnn I'll be working on this. It may need fixes in reactor pool. |
We do register cancel callback, see Lines 211 to 220 in 40a880e
|
@violetagg Thank you for your reply. I have also noticed the reactor-pool project and have attempted to submit a PR #256. Apart from the callback mentioned in your reply, do we need to register a callback for PooledConnectionInitializer and ClientTransportSubscriber as well? In the version I tried to modify, it seems that if callbacks are not registered for them, acquiring a connection cannot be canceled either. |
@qnnn I'm closing this issue. Once an acquisition is started we do not want to stop the connection establishment, so that the connection (if established) will stay in the pool and reused. |
Expected Behavior
The sequence for acquiring the connection will be cancelled after the request ends.
Actual Behavior
The sequence for acquiring the connection was not cancelled after the request ended.
Steps to Reproduce
I recently encountered a small issue while using Spring Cloud Gateway. After the request reaches the
responseTimeout
value and the response is sent back (due to a connection timeout), the program continues to retry connecting to other DNS-resolved addresses. (For example,responseTimeout = 8s
,connectionTimeout = 5s
, and there are three addresses in the DNS resolution result.)It seems that after the outer sequence is cancelled, the inner sequence responsible for acquiring the connection is not able to detect this cancellation. Does this behavior align with the phenomenon simulated in the following flow? (I’m just trying to learn.)
Possible Solution
Your Environment
The text was updated successfully, but these errors were encountered: