Skip to content

Commit

Permalink
store: use noop pool
Browse files Browse the repository at this point in the history
Simply not returning slices leads to exhausted pool errors. Use noop
pool instead that returns slices directly.

Signed-off-by: Giedrius Statkevičius <[email protected]>
  • Loading branch information
GiedriusS committed Dec 4, 2024
1 parent b442da7 commit 0c08c63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions cmd/thanos/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/thanos-io/thanos/pkg/info/infopb"
"github.com/thanos-io/thanos/pkg/logging"
"github.com/thanos-io/thanos/pkg/model"
"github.com/thanos-io/thanos/pkg/pool"
"github.com/thanos-io/thanos/pkg/prober"
"github.com/thanos-io/thanos/pkg/runutil"
grpcserver "github.com/thanos-io/thanos/pkg/server/grpc"
Expand Down Expand Up @@ -388,10 +389,7 @@ func runStore(

queriesGate := gate.New(extprom.WrapRegistererWithPrefix("thanos_bucket_store_series_", reg), int(conf.maxConcurrency), gate.Queries)

chunkPool, err := store.NewDefaultChunkBytesPool(uint64(conf.chunkPoolSize))
if err != nil {
return errors.Wrap(err, "create chunk pool")
}
chunkPool := pool.NoopPool[byte]{}

options := []store.BucketStoreOption{
store.WithLogger(logger),
Expand Down
6 changes: 3 additions & 3 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -3515,9 +3515,9 @@ func (r *bucketChunkReader) Close() error {
}
r.block.pendingReaders.Done()

//for _, b := range r.chunkBytes {
// r.block.chunkPool.Put(b)
//}
for _, b := range r.chunkBytes {
r.block.chunkPool.Put(b)
}
return nil
}

Expand Down

0 comments on commit 0c08c63

Please sign in to comment.