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

Fix: TraceClient crashed in absense of a parentSpan in Context #314

Merged
merged 1 commit into from
Jul 9, 2016

Conversation

basvanbeek
Copy link
Member

yeah that's unfortunate... we used to not care if parentSpan existed or not but since we now dereference the SpanContext we must test for it...

@peterbourgon
Copy link
Member

Is it possible to write a previously-failing, now-succeeding test for this?

@basvanbeek
Copy link
Member Author

basvanbeek commented Jul 8, 2016

This was a dumb oversight on my end while refactoring from old to new API.

The old api allowed you to drop in a span itself which was allowed to be nil. I now have to actually dereference the span (so it must exist) to get to its Context property.

Not sure what an extra test would help with

@basvanbeek
Copy link
Member Author

Added test to safeguard from regressions...

Added TestTraceClientNoContextSpan to test for this situation
@peterbourgon
Copy link
Member

Confirmed test fails on current master. LGTM!

@basvanbeek basvanbeek merged commit 5342741 into go-kit:master Jul 9, 2016
jamesgist pushed a commit to jamesgist/kit that referenced this pull request Nov 1, 2024
Fix: TraceClient crashed in absense of a parentSpan in Context
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

Successfully merging this pull request may close these issues.

2 participants