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

add connection pool so we don't leak connections #152

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Conversation

haisum
Copy link
Contributor

@haisum haisum commented Nov 13, 2023

Connections are leaked and recreated when -crd-connect is passed. This change adds connection pooling as implemented in nats-surveyor https://github.com/nats-io/nats-surveyor/blob/main/surveyor/conn_pool.go

Tested by reproducing findings mentioned in #151. Controller no longer keeps unnecessary connections open and does not leak them on errors in reconcile loop.

Resolves #151

controllers/jetstream/consumer.go Outdated Show resolved Hide resolved
controllers/jetstream/stream.go Outdated Show resolved Hide resolved
Copy link
Contributor

@caleblloyd caleblloyd left a comment

Choose a reason for hiding this comment

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

LGTM

@haisum haisum merged commit d670bf2 into main Nov 13, 2023
2 checks passed
@haisum haisum deleted the connection-pool branch November 13, 2023 18:58
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.

Connections to NATS server not closed
3 participants