mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #105573 from sttts/sttts-etcd-storage-free-kv-early
apiserver/storage: free etcd kv early in list decoding loop
This commit is contained in:
commit
f6facec054
@ -763,7 +763,7 @@ func (s *store) List(ctx context.Context, key string, opts storage.ListOptions,
|
||||
}
|
||||
|
||||
// take items from the response until the bucket is full, filtering as we go
|
||||
for _, kv := range getResp.Kvs {
|
||||
for i, kv := range getResp.Kvs {
|
||||
if paging && int64(v.Len()) >= pred.Limit {
|
||||
hasMore = true
|
||||
break
|
||||
@ -779,6 +779,9 @@ func (s *store) List(ctx context.Context, key string, opts storage.ListOptions,
|
||||
return err
|
||||
}
|
||||
numEvald++
|
||||
|
||||
// free kv early. Long lists can take O(seconds) to decode.
|
||||
getResp.Kvs[i] = nil
|
||||
}
|
||||
|
||||
// indicate to the client which resource version was returned
|
||||
|
Loading…
Reference in New Issue
Block a user