Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix limit env vars unset/unlimited values #2054
Fix limit env vars unset/unlimited values #2054
Changes from 4 commits
061e72c
18574c4
90b361a
697846f
fdd4610
1ca4c52
303ed43
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't we use
unset
so users should define it explicitly and can avoid the sudden surprise when not setting env either by no knowledge/ignorance considered as unlimited?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did but spec recommends using empty value as unlimited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try to convince others and update spec to accept "unset" as the value but for now I think we should update our SDK to make sure it is spec compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm not fully understanding this scenario. When will
value
ever be "unset"? Isn't value supposed to be anint
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API usage looks like the following in order to not set a limit:
SpanLimits.UNSET is a symbol that users can pass as a limit to set the limit to infinity. We can freely change its internal value to anything without breaking any contracts.
The reason why I used "unset" was that I thought -1 might be confusing as the spec disallows it for env vars. Internally we can still use -1 as the symbol value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it back to -1 as this is probably causing more confusion and does not respect the function contract. I wonder why mypy didn't catch it.