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

Potential shutdown subscriptions leaks #26

Open
weidonglian opened this issue Dec 11, 2020 · 1 comment
Open

Potential shutdown subscriptions leaks #26

weidonglian opened this issue Dec 11, 2020 · 1 comment

Comments

@weidonglian
Copy link

I notice the subscribe client when being closed/shutdown, it will loop a map[string]subscription and wait to close each subscription. How about if we subscribe to the same topic a couple of times in one app which could be possibly done through different modules? Then we will override the subscription in the map with the same topic and we won't gracefully shutdown.

type struct subscriptionEntry {
topic string
subscription *stan.Subscription
}

A slice []subscriptionEntryt might be good enough instead of a map.

How to do unsubscribe? I know in most cases, we do not need to.

@weidonglian weidonglian changed the title Potential shutdown subscriptions Potential shutdown subscriptions leaks Dec 11, 2020
@arbarlow
Copy link
Contributor

I think you're referring to the nats plugin? I'm afraid I don't personally use this at the moment, so that would explain little bugs like this.

But I think you're right! I'll happily accept a pr that fixes this if you have the time.

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

No branches or pull requests

2 participants