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

trickstercache / trickster / 27907115766
89%

Build:
DEFAULT BRANCH: main
Ran 21 Jun 2026 02:22PM UTC
Jobs 2
Files 308
Run time 1min
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

21 Jun 2026 02:16PM UTC coverage: 89.16% (+0.05%) from 89.115%
27907115766

push

github

web-flow
fix+test: [timeseries] panic on ExtentList.Splice when shard count exceeds len(el)*4 hint (#1016)

* fix+test: [timeseries] panic on ExtentList.Splice when shard count exceeds len(el)*4 hint

spliceByTime and spliceByTimeAligned pre-allocated their result slice
with a fixed `len(el)*4` length and used `out[k] = ...` indexed writes.
When the requested time range produces more than 4 shards per input
extent — easily reached on any backend running with shard_max_size_time
(e.g., 6h range / 1h shard = 6 shards, 30d / 1h = 720 shards) — the
loop indexes past the slice length and panics with:

    runtime error: index out of range [N] with length N
    pkg/timeseries.ExtentList.spliceByTime (extent_list.go:249)

The panic surfaces as an upstream proxy-error from DeltaProxyCache
and an empty body to the caller; from a Grafana dashboard's perspective
the long-range query simply fails.

This patch:

1. Computes an upper-bound shard count from the requested range and
   maxRange before allocating, so the slice has enough capacity for
   every shard that the loop will produce (+ a small safety margin for
   the boundary tick at the end of each extent).

2. Switches from length-based pre-allocation + indexed writes to
   capacity-based pre-allocation + append. Combined with (1), large
   ranges (720 shards = 30d at 1h cadence) allocate once with no
   growth; small ranges allocate the same as before.

3. Adds regression coverage:
   - spliceByTime high shard count (6h / 1h = 7 shards) — the minimal
     case that panicked under the old fixed-4 hint.
   - spliceByTime stress 7d/1h (168 shards) and 30d/1h (720 shards) —
     real-world Grafana dashboard ranges that previously panicked.

All existing TestSplice subtests continue to pass.

Signed-off-by: thinker0 <thinker0@gmail.com>

* refactor: [timeseries] drop self-referential bug comments per PR review

Comments referenced the panic this PR fixes; once merged the historical
context becomes noise. The patched mat... (continued)

38 of 42 new or added lines in 1 file covered. (90.48%)

2 existing lines in 1 file now uncovered.

20769 of 23294 relevant lines covered (89.16%)

1.55 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
97.23
-1.04% pkg/timeseries/extent_list.go

Coverage Regressions

Lines Coverage ∆ File
2
98.36
-1.64% pkg/proxy/engines/progressive_collapse_forwarder.go
Jobs
ID Job ID Ran Files Coverage
1 integration - 27907115766.1 21 Jun 2026 02:24PM UTC 301
53.17
GitHub Action Run
2 unit-Go-1.26 - 27907115766.2 21 Jun 2026 02:22PM UTC 304
84.12
GitHub Action Run
Source Files on build 27907115766
  • Tree
  • List 308
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 92449d75 on github
  • Prev Build on main (#27889223784)
  • Next Build on main (#28036720842)
  • Delete
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