NVIDIA / NVIDIA/TensorRT-LLM

[Bug]: etcd cluster storage loses stored empty-string values

Open Beginner friendly
#17,765 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Infra
Dominant language
Python
Stars
14.7k
Forks
2.8k
Avg merge
2d 23h
Merged PRs (30d)
489

Description

System Info

Platform-independent etcd cluster-storage behavior on current main.

Reproduction

Etcd3ClusterStorage.get() uses the truthiness of the returned bytes to distinguish a missing key:

data, meta = self.client.get(key)
return data.decode('utf-8') if data else None

An existing key containing the valid empty string is returned by etcd as b"", which is falsey, so the storage layer converts it to None and makes it indistinguishable from a missing key. The HTTP backend preserves empty strings.

Expected behavior

Return "" when the key exists with an empty value, and None only when the etcd client returns no data.

Actual behavior

Both an empty stored value and a missing key return None.

Proposed fix

Check data is not None instead of truthiness and add CPU-only mocked regression coverage for both empty and missing values.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Etcd3ClusterStorage.get() entry point and inspect how the client returns data for existing and missing keys. Add CPU-only mocked regression coverage for an existing empty value and a missing value, with completion shown by returning "" for the former and None for the latter.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.