Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] panic: runtime error: slice bounds out of range #552

Open
flucrezia opened this issue Mar 13, 2023 · 0 comments
Open

[BUG] panic: runtime error: slice bounds out of range #552

flucrezia opened this issue Mar 13, 2023 · 0 comments
Labels

Comments

@flucrezia
Copy link

Describe the bug
Panic when max-metrics-rendered is less than number of files in a single render call.
To reproduce:

  • Set a (relative) small value of max-metrics-rendered in go-carbon.conf
  • Set maxBatchSize = 0 in carbonapi config file
  • Query thousands of metrics in a single render call (> than max-metrics-rendered)

Logs
**panic: runtime error: slice bounds out of range [:1000] with capacity 0

goroutine 7080414 [running]:
github.com/go-graphite/go-carbon/carbonserver.(*CarbonserverListener).prepareDataStream(0xc000208380, {0xf70c78, 0xc085090cf0}, 0x3, 0xc013e2e228?, 0x0?, 0xc008fcb740)
/usr/local/src/go-carbon/carbonserver/render.go:423 +0xf45
github.com/go-graphite/go-carbon/carbonserver.(CarbonserverListener).prepareDataProto.func1()
/usr/local/src/go-carbon/carbonserver/render.go:493 +0xb3
created by github.com/go-graphite/go-carbon/carbonserver.(CarbonserverListener).prepareDataProto
/usr/local/src/go-carbon/carbonserver/render.go:491 +0x4d5

Go-carbon Configuration:
max-metrics-rendered = 1000

Commenting the above line to use the default value avoids the runtime error.

@flucrezia flucrezia added the bug label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant