Skip to content

Conversation

@mtryfoss
Copy link
Contributor

@mtryfoss mtryfoss commented Jul 1, 2020

This is an approach to fix leaking subscriptions.

I've tested it with about thousand normal calls and it show no leak using pprof yet.
I'm going to test a lot more, but I would like your opinions.

Much of the code is pulled from ari/stdbus.

It still doesn't close unused NATS-subscriptions, but I find that not a big issue since they anyway are reused.


This change is Reviewable

Copy link
Member

@Ulexus Ulexus left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @mtryfoss)

a discussion (no related file):
I think the appropriate thing to do is to change stdbus to export these components. Since stdbus has tests, I'd prefer to keep using that as the canonical source rather than copy-pasting the code.

It might be that we need to restructure stdbus to make this easier, too, which I'm fine with.



client/bus/bus.go, line 15 at r2 (raw file):

// subscriptionEventBufferSize defines the number of events that each
// subscription will queue before accepting more events.

/accepting/rejecting/ (Yep, it's a problem with my original)

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.

2 participants