[ 
https://issues.apache.org/jira/browse/HTRACE-301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Colin Patrick McCabe updated HTRACE-301:
----------------------------------------
    Description: 
We have a few unit tests that aren't waiting for spans to be written, but which 
should.  For example, TestClientOperations intermittently fails due to missing 
spans. According to the test log, FindSpan was called before the span is 
written to datastore.

This patch replaces WriteSpans with a semaphore.  The reasoning is that it is 
sometimes difficult to debug unit tets where the datastore is blocked sending 
to the WriteSpans debug channel because the test has become blocked or is 
exiting.  Buffered channels could eliminate this problem, but for certain 
tests, the buffers would have to be extremely large.  Using a semaphore 
eliminates this problem.  Semaphores will also be more efficient when we start 
ingesting spans in batches (see HTRACE-298) since we can increment the 
semaphore once rather than sending multiple spans on the WriteSpans channel.  
This is important for getting realistic benchmarks.


  was:TestClientOperations intermittently fails due to missing span. According 
to the test log, FindSpan was called before the span is written to datastore.


> htraced: fix unit tests that aren't waiting for spans to be written, use 
> semaphore for WrittenSpans
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HTRACE-301
>                 URL: https://issues.apache.org/jira/browse/HTRACE-301
>             Project: HTrace
>          Issue Type: Bug
>          Components: htraced
>            Reporter: Masatake Iwasaki
>            Assignee: Masatake Iwasaki
>            Priority: Minor
>
> We have a few unit tests that aren't waiting for spans to be written, but 
> which should.  For example, TestClientOperations intermittently fails due to 
> missing spans. According to the test log, FindSpan was called before the span 
> is written to datastore.
> This patch replaces WriteSpans with a semaphore.  The reasoning is that it is 
> sometimes difficult to debug unit tets where the datastore is blocked sending 
> to the WriteSpans debug channel because the test has become blocked or is 
> exiting.  Buffered channels could eliminate this problem, but for certain 
> tests, the buffers would have to be extremely large.  Using a semaphore 
> eliminates this problem.  Semaphores will also be more efficient when we 
> start ingesting spans in batches (see HTRACE-298) since we can increment the 
> semaphore once rather than sending multiple spans on the WriteSpans channel.  
> This is important for getting realistic benchmarks.



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

Reply via email to