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

trickstercache / trickster / 22739592855

05 Mar 2026 10:22PM UTC coverage: 73.04% (+0.2%) from 72.818%
22739592855

push

github

web-flow
fix: [proxy/engines] refactor and fix singleflight optimization (#939)

* fix: [proxy/engines] use isExecutor flag for singleflight caller disambiguation

singleflight.Do returns shared=true for the executor too when there are
waiters, not just for waiters. In OPC this caused the executor to double-
write its response body; in DPC the executor's cache status was wrongly
reported as proxy-hit instead of kmiss.

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* test: [proxy/engines] add singleflight deduplication tests for OPC and DPC

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* fix: [proxy/engines] propagate error response bodies to singleflight waiters

When the origin returns a non-cacheable error (e.g. 502), the OPC
singleflight opcResult body was empty because cacheBuffer is only
populated when writeToCache is true.

Also fixes a data race in the DPC ProxyError path where all callers shared result.headers without
cloning.

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* fix: [proxy/engines] propagate handler errors to OPC singleflight waiters

When a handler inside the OPC singleflight closure returned an error
(e.g., cache store failure), the closure returned (nil, fErr), causing
waiters to receive no HTTP response at all. The executor's response was
written normally but waiters got LookupStatusError with no body.

Also guard against nil pr.upstreamResponse after Do() returns, which
can occur if the handler errored before contacting upstream.

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* refactor: [proxy/engines] align OPC/DPC singleflight patterns

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* chore: comment cleanup

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* refactor: [proxy/engines] clean up singleflight comments and naming

Signed-off-by: Chris Randles <randles.chris@gmail.com>

* dashboard: extend prom dashboard to support window selection

Signed-off-by: Chris Randles <r... (continued)

160 of 185 new or added lines in 3 files covered. (86.49%)

5 existing lines in 2 files now uncovered.

14979 of 20508 relevant lines covered (73.04%)

0.84 hits per line

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

84.92
/pkg/proxy/engines/objectproxycache.go


Source Not Available

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