Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We were leaking memory steadily in `golang.org/x/net/http2.(*ClientConn).frameScratchBuffer` every time we retrieved a new set of credentials. I believe this is because we were never closing the response body when we were retrieving a lease from vault. From my testing, it seems that the rate at which memory was leaking was also exacerbated by the fact that we were creating a new `*vault.Config` every time we retrieved credentials from vault. Presumably this was because we were creating a new pool of connections (and therefore a new set of scratch buffers) for each config, although I haven't fully validated this hypothesis. See: golang/go#38049. Ensuring that the response body is closed after decoding the json from it and using one `*vault.Config` seems to stop the leak. I've also added the UW operational endpoint so that we can profile these issues live in future.
- Loading branch information