Non-deterministic selection of deserializer
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 265
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 4
Description
I ran into an issue where something seems to randomly choose from representing an integer field to be deserialized as either config's Value, or serde's Content. When it is the the first, the into_uint logic in Value correctly parses the string configuration (coming from an Environment source) but when it is running into deserializing Content::String then it fails with
Failed to parse config: invalid type: string "1234", expected u16
I could not figure out where the non-determinism is coming from.
The following repository reproduces the problem:
https://github.com/vigoo/rust-config-bug
just running cargo run multiple times, sometimes it works, sometimes fails with the above error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproducer and run cargo run repeatedly to confirm the intermittent failure. Trace how integer fields are deserialized when the source is an environment value, particularly the paths involving config's Value and serde's Content. Done means the reproducer no longer changes behavior between runs and the failure is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100