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

trickstercache / trickster / 27907115766 / 1
89%
main: 89%

Build:
DEFAULT BRANCH: main
Ran 21 Jun 2026 02:24PM UTC
Files 301
Run time 6s
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: 53.173% (+0.2%) from 52.951%
27907115766.1

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)

12268 of 23072 relevant lines covered (53.17%)

0.6 hits per line

Source Files on job integration - 27907115766.1
  • Tree
  • List 301
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 27907115766
  • 92449d75 on github
  • Prev Job for on main (#27889223784.2)
  • Next Job for on main (#28036720842.1)
  • 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