[ 
https://issues.apache.org/jira/browse/HTRACE-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14648490#comment-14648490
 ] 

Colin Patrick McCabe commented on HTRACE-209:
---------------------------------------------

bq. Is the below from htrace-c/src/core/conf.c meant to be part of this patch?

This fixes a bug in the C client where we would loop forever when trying to 
convert a configuration string to an integer that had garbage at the end.  I 
can split it out into a separate patch if you want.

bq. ... is passing NULL (to htrace_span_id_generate) right? In the else, we 
pass in cur_scope->span...

The code only passes NULL if there is no current scope, or the current scope 
has no span.  So basically only in the case where there are no parents.

{code}
    cur_scope = htracer_cur_scope(tracer);
    if ((!cur_scope) || (!cur_scope->span)) {
        if (!sampler->ty->next(sampler)) {
            return NULL;
        }
        htrace_span_id_generate(&span_id, tracer->rnd, NULL);
    } else {
        htrace_span_id_generate(&span_id, tracer->rnd,
                                &cur_scope->span->span_id);
    }
{code}

bq. Nit. Not important. Would it be easier if below returned true if it set 
span id? Would it streamline use of the method in that you would not have to 
test the id for valid or empty after the call?

Hmm, good question.  This is private API for right now (it should not be 
exposed in the header file) so we can think about it later, I think.  This 
function is really only needed in the public API if you want to manually 
specify parent span IDs... something we don't support yet in the C client (but 
we should add eventually).

bq. Should this buf size be +1?

Yeah, it should be.  Luckily I passed the buffer size through, so this wouldn't 
have been a buffer overflow, but the error message would not have printed 
successfully.

bq. You don't do the spiel about the top 64 bits being carried over from parent 
in 34 * @file span_id.c or in .h (Is there anything we can do to fail if this 
is not the case)

I'll add some text there.  {{htrace_span_id_generate}} does carry over the top 
64 bits.

bq. Did you want to rename TraceTree in this patch (or do it in follow on?) 
Latter is fine by me.

Yeah, let's do it now.  Also, let's move it into the testing package...

bq. 23  htrace.INVALID_SPAN_ID = "00000000-0000-0000-0000-000000000000";

Good catch

> Make span ID 128 bit to avoid collisions
> ----------------------------------------
>
>                 Key: HTRACE-209
>                 URL: https://issues.apache.org/jira/browse/HTRACE-209
>             Project: HTrace
>          Issue Type: Sub-task
>    Affects Versions: 4.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HTRACE-209.001.patch, HTRACE-209.002.patch, 
> HTRACE-209.004.patch, HTRACE-209.005.patch, HTRACE-209.006.patch
>
>
> Make span ID 128 bit to avoid collisions in htrace 4.x



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to