Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

fix: close session when unable to connect #81

Merged
merged 5 commits into from
Dec 17, 2019

Conversation

neverchanje
Copy link

@neverchanje neverchanje commented Dec 17, 2019

In addition to being able to close a session when it's still connecting, in this PR we also make connection warmup (connect before sending RPC) only runs when the session is disconnected.

How does it work

To close the session when it's still connecting, we modified ReplicaSession#closeSession and call markSessionDisconnect after identifying that it's CONNECTING. This is intended to fix the bug #80.

To make connection warmup only runs when the session is disconnected, we wrapped doConnect as tryConnect, which checks if the session is disconnected. If not, it will do nothing.

@neverchanje neverchanje merged commit fac0ffa into XiaoMi:thrift-0.11.0-inlined Dec 17, 2019
@neverchanje neverchanje deleted the fixlog branch December 17, 2019 09:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants