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

improve rpc conn pool #1916

Merged
merged 2 commits into from
May 15, 2024
Merged

improve rpc conn pool #1916

merged 2 commits into from
May 15, 2024

Conversation

tudor-malene
Copy link
Collaborator

Why this change is needed

We seem to have a resource leak on the TG RPC conn pool

What changes were made as part of this PR

  • return connection in some error cases
  • add context to the borrowing method
  • improve logging

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

Copy link
Collaborator

@BedrockSquirrel BedrockSquirrel left a comment

Choose a reason for hiding this comment

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

LGTM, minor suggestion

@@ -270,7 +271,7 @@ func (w *Services) Version() string {
}

func (w *Services) GetTenNodeHealthStatus() (bool, error) {
res, err := withPlainRPCConnection[bool](w, func(client *gethrpc.Client) (*bool, error) {
res, err := withPlainRPCConnection[bool](context.Background(), w, func(client *gethrpc.Client) (*bool, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe worth putting a timeout on this context too in case the conn pool is gummed up?

@tudor-malene tudor-malene merged commit 41095b4 into main May 15, 2024
2 checks passed
@tudor-malene tudor-malene deleted the tudor/release_conn branch May 15, 2024 12:42
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