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

Returns invalid traceflags for a bad string parse instead of throwing… #2937

Closed
wants to merge 1 commit into from

Conversation

anuraaga
Copy link
Contributor

… an exception.

Supercedes #2869

This removes the one and only place in the API that still declares it throws an exception. It avoids returning null, as in #2869, to reduce the chance of problems with usage of the API, an invalid traceflags should be handled by a propagator. But in the chance it's not handled, it will act as an empty traceflags and not cause crashes.

This is a behavior change which I agree with @bogdandrutu we need to make now or never since, i.e. a propagator that relied on the exceptions to handle invalid would not do so anymore if we removed them later. As TraceFlags presumably has no real use case outside of the w3c propagator, I'm comfortable with squeezing this into the release but open to thoughts.

return TraceId.isValid(getTraceId()) && SpanId.isValid(getSpanId());
return TraceId.isValid(getTraceId())
&& SpanId.isValid(getSpanId())
&& getTraceFlags().isValid();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a change from the specification, I believe, which says that the SpanContext is valid iff the spanid and traceid are valid, but doesn't mention trace flags.

@Oberon00
Copy link
Member

I think introducing the concept of invalid trace flags is something that should go through the spec. Compare also open-telemetry/opentelemetry-specification#753

@jkwatson jkwatson removed this from the 1.0 milestone Mar 2, 2021
@jkwatson jkwatson added the blocked:spec blocked on open or unresolved spec label Jun 8, 2021
@jkwatson jkwatson removed the request for review from tylerbenson April 8, 2022 17:25
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 22, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:spec blocked on open or unresolved spec Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants