• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pomerium / pomerium / 17473880261
52%

Build:
DEFAULT BRANCH: main
Ran 04 Sep 2025 07:02PM UTC
Jobs 1
Files 543
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Sep 2025 06:56PM UTC coverage: 54.1% (+0.08%) from 54.019%
17473880261

push

github

web-flow
grpcutil: add client manager (#5811)

## Summary
Add a new `ClientManager` in `grpcutil`. 

Typically with gRPC you create a single client connection to a static
endpoint and re-use it throughout your application. It handles all the
lifecycle management for underlying connections.

If your network is dynamic rather than static, you'd typically use DNS
(or a similar mechanism) to switch to different servers, and still rely
on a single client connection.

However if we are establishing connections to endpoints that are defined
from configuration, those endpoints can change over time. We could
maintain a map of gRPC client connections for each endpoint, but with
frequent configuration changes this is a memory leak or requires careful
coordination to close connections that are no longer used. This can
happen if endpoints change (you are connecting to different
databrokers), or if settings change (we are using a new shared key).

So instead this PR introduces a "lazy" client that establishes gRPC
connections on-demand, and closes them when they are idle using a timer
that's reset on every request. Once the lazy client is no longer used,
it will be garbage collected, and the idle timer will close the
connection avoiding the memory leak.


## Checklist

- [ ] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review

118 of 148 new or added lines in 1 file covered. (79.73%)

8 existing lines in 5 files now uncovered.

25921 of 47913 relevant lines covered (54.1%)

90.37 hits per line

Uncovered Changes

Lines Coverage ∆ File
30
79.73
pkg/grpcutil/client_manager.go

Coverage Regressions

Lines Coverage ∆ File
2
90.91
-3.64% pkg/fanout/receive.go
2
91.3
-8.7% pkg/grpcutil/serve.go
2
96.88
-1.04% pkg/identity/manager/schedulers.go
1
79.36
-0.29% pkg/storage/postgres/backend.go
1
75.41
0.0% pkg/storage/postgres/registry.go
Jobs
ID Job ID Ran Files Coverage
1 17473880261.1 04 Sep 2025 07:02PM UTC 543
54.1
GitHub Action Run
Source Files on build 17473880261
  • Tree
  • List 543
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #17473880261
  • 38d82c1c on github
  • Prev Build on main (#17451115609)
  • Next Build on main (#17474052796)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc