hashicorp / hashicorp/vault-plugin-database-elasticsearch

BUG:net/http.(*persistConn) goroutine leak

Open
#110 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
31
Forks
8
Avg merge
2d 1h
Merged PRs (30d)
2

Description

Grafana dashboards indicate a continuous increase in the Goroutine count within the Vault service.

Image

A subsequent pprof analysis revealed a significant number of persistent HTTP connections that are not being closed.

Image

These connections all originate from and are directed towards Elasticsearch.

Image

The [buildClient function](https://github.com/hashicorp/vault-plugin-database-elasticsearch/blob/main/elasticsearch.go#L286) is used for all Elasticsearch calls, but its connection pool is only configured with TLSClientConfig.

Vault Version:1.14

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the buildClient function in elasticsearch.go at line 286 and inspect how its HTTP connection pool is configured for Elasticsearch calls. Use the reported Grafana goroutine increase and pprof findings as the reproduction signals. Done means persistent HTTP connections no longer accumulate during Vault's Elasticsearch activity.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, go
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.