You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@htrace.apache.org by "Colin Patrick McCabe (JIRA)" <ji...@apache.org> on 2015/11/20 01:43:11 UTC
[jira] [Commented] (HTRACE-301) htraced: fix unit tests that aren't
waiting for spans to be written, use semaphore for WrittenSpans
[ https://issues.apache.org/jira/browse/HTRACE-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014885#comment-15014885 ]
Colin Patrick McCabe commented on HTRACE-301:
---------------------------------------------
Here's a patch that should fix this stuff. Like I wrote above, this also replaces the WrittenSpans channel with a semaphore. It's just more efficient and works better for "big" unit tests or benchmarks where we want maximum performance and we have a lot of spans. WrittenSpans has always been just a unit test thing... it's not used in production, so hopefully this patch is easy to review.
> 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
> Attachments: HTRACE-301.001.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)