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

Non-deterministic selection of deserializer #501

Open
vigoo opened this issue Nov 24, 2023 · 0 comments
Open

Non-deterministic selection of deserializer #501

vigoo opened this issue Nov 24, 2023 · 0 comments

Comments

@vigoo
Copy link

vigoo commented Nov 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant