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

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

Thanks again for diagnosing this, [~iwasakims].  I guess I have to think this 
through carefully.  Why allow double detach on {{NullScope}}, but not on other 
scopes?  I guess one reason is so that you can turn off HTrace and not get 
exceptions from incorrect use of htrace.  I can't think of any other reasons, 
to be honest... if you turn on tracing (or use something like AlwaysSampler), 
you will hit the problem again, right?  Because you'll never get NullScope with 
AlwaysSampler.

So we're really just sweeping a problem in the hbase code under the rug.  
Without this patch, hbase unit tests might catch double detach issues in hbase. 
 With this patch, they will be silently ignored unless the unit test turns on 
htrace (which I don't think many of them do).

The other angle is compatibility.  We won't be able to use the version of HBase 
1.0.0 that has been released against the upcoming HTrace 3.2 without this 
patch, clearly.  Even if htrace is disabled, the incorrect API use will 
generate exceptions.

However, isn't this OK?  HBase 1.0.0 will never have to deal with htrace 3.2... 
it only has to deal with the version of htrace that it shipped with, which was 
3.1, which did NO error checking.  The only possible difficulty I see is that 
since Hadoop 2.7 will use htrace 3.2, it won't be possible to run an HBase 
1.0.0 + Hadoop 2.7 stack.  But that's ok, right?... Hadoop 2.7 is still in the 
future.

How difficult would it be to fix the hbase code not to do double detach?  I 
really think that's the best solution.

> detach of NullScope singleton should not fail
> ---------------------------------------------
>
>                 Key: HTRACE-119
>                 URL: https://issues.apache.org/jira/browse/HTRACE-119
>             Project: HTrace
>          Issue Type: Bug
>    Affects Versions: master
>            Reporter: Masatake Iwasaki
>            Assignee: Masatake Iwasaki
>         Attachments: HTRACE-119.001.patch
>
>
> The {{detach}} method of NullScope singleton is possible to be called 
> multiple times by users avoiding conditionals by the assumption that 
> NullScope#close and NullScope#detach results in no-op. Calling {{detach}} of 
> NullScope singleton multiple times throws RuntimeException by HTRACE-101 now.



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

Reply via email to