Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates test and optimizes collector scheduler #3351

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015-2021 The OpenZipkin Authors
Copyright 2015-2023 The OpenZipkin Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
@@ -85,9 +85,9 @@
<git-commit-id.version>4.0.3</git-commit-id.version>

<!-- Test only dependencies -->
<junit.version>4.13.1</junit.version>
<junit.version>4.13.2</junit.version>
<junit-jupiter.version>5.9.2</junit-jupiter.version>
<mockito.version>3.6.28</mockito.version>
<mockito.version>3.8.0</mockito.version>
<assertj.version>3.18.1</assertj.version>
<awaitility.version>4.0.3</awaitility.version>
<hamcrest.version>1.3</hamcrest.version>
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ static final class SpanService extends AbstractUnsafeUnaryGrpcService {
this.metrics = metrics;
}

@Override protected CompletionStage<ByteBuf> handleMessage(ServiceRequestContext srCtx, ByteBuf bytes) {
@Override protected CompletionStage<ByteBuf> handleMessage(ServiceRequestContext ctx, ByteBuf bytes) {
metrics.incrementMessages();
metrics.incrementBytes(bytes.readableBytes());

@@ -68,15 +68,7 @@ static final class SpanService extends AbstractUnsafeUnaryGrpcService {

try {
CompletableFutureCallback result = new CompletableFutureCallback();

// collector.accept might block so need to move off the event loop. We make sure the
// callback is context aware to continue the trace.
Executor executor = ServiceRequestContext.mapCurrent(
ctx -> ctx.makeContextAware(ctx.blockingTaskExecutor()),
CommonPools::blockingTaskExecutor);

collector.acceptSpans(bytes.nioBuffer(), SpanBytesDecoder.PROTO3, result, executor);

collector.acceptSpans(bytes.nioBuffer(), SpanBytesDecoder.PROTO3, result, ctx.blockingTaskExecutor());
return result;
} finally {
bytes.release();