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

spiffe / java-spiffe / 42108689911

05 Nov 2026 09:00PM UTC coverage: 88.237% (-0.1%) from 88.346%
42108689911

push

github

maxlambrecht
fix(workloadapi): stop newSource from storing defaults in the source options

DefaultX509Source.newSource, DefaultJwtSource.newSource and
CachedJwtSource.newSource stored the Workload API client they created,
and DEFAULT_TIMEOUT, in the options object passed by the caller.

When initialization failed, for example because initTimeout expired
before the SPIRE agent was available, newSource closed the source and so
closed that client, but the options kept a reference to it. Every later
newSource call with the same options reused the closed client and failed
immediately with "Cannot register watch on closed Workload API client",
so a retry loop never recovered even after the agent came up. After a
successful call, a second source created from the same options shared
the first one's client, and closing either source broke the other.

Keep the client and the timeout in local variables instead. newSource no
longer modifies its argument, and each call without a configured client
creates its own. A client set in the options is used, and closed with the
source, as before.

Fixes #497

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>

522 of 667 branches covered (78.26%)

Branch coverage included in aggregate %.

1916 of 2096 relevant lines covered (91.41%)

3.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.46
/io/spiffe/workloadapi/JwtSourceOptions.java


Source Not Available

The file "io/spiffe/workloadapi/JwtSourceOptions.java" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc