[
https://issues.apache.org/jira/browse/HTRACE-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15015062#comment-15015062
]
Masatake Iwasaki commented on HTRACE-301:
-----------------------------------------
+1. Committed this. Thanks, [~cmccabe]!
> 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: Colin Patrick McCabe
> Priority: Minor
> Fix For: 4.1
>
> Attachments: HTRACE-301.001.patch, HTRACE-301.002.patch
>
>
> 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)