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

Use a separate gorutine to handle the logic of reconnect #691

Merged
merged 6 commits into from
Dec 27, 2021

Conversation

wolfstudy
Copy link
Member

@wolfstudy wolfstudy commented Dec 24, 2021

Signed-off-by: xiaolongran xiaolongran@tencent.com

Fixes #687

Motivation

As #687 said, use a separate gorutine to handle the logic of reconnect. Avoid blocking the reconnection logic due to the gorutine block of runEventsLoop

Signed-off-by: xiaolongran <xiaolongran@tencent.com>
@wolfstudy wolfstudy added this to the v0.8.0 milestone Dec 24, 2021
@wolfstudy wolfstudy self-assigned this Dec 24, 2021
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
@wolfstudy wolfstudy changed the title Split eventsCh to use a separate Channel to handle runEventsLoop Use a separate gorutine to handle the logic of reconnect Dec 27, 2021
@wolfstudy wolfstudy merged commit 39e13ac into apache:master Dec 27, 2021

go func() {
for {
for range p.connectClosedCh {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is going to leak a go routine since the p.connectClosedCh is never closed?

wolfstudy pushed a commit that referenced this pull request Jan 6, 2022
wolfstudy added a commit that referenced this pull request Jan 6, 2022
* Revert "Use a separate gorutine to handle the logic of reconnect (#691)"

This reverts commit 39e13ac.

* add closeCh for go rutine leak

Signed-off-by: xiaolongran <xiaolongran@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discuss] Split eventsCh to use a separate Channel to handle runEventsLoop
3 participants