Skip to content

Commit 1a8e35e

Browse files
minwooxAdrian Cole
authored and
Adrian Cole
committed
Updates test and optimizes collector scheduler
- Test - Junit4 4.13.1 -> 4.13.2 - Mockito 3.6.28 -> 3.8.0
1 parent 18102bc commit 1a8e35e

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2015-2021 The OpenZipkin Authors
4+
Copyright 2015-2023 The OpenZipkin Authors
55
66
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
77
in compliance with the License. You may obtain a copy of the License at
@@ -85,9 +85,9 @@
8585
<git-commit-id.version>4.0.3</git-commit-id.version>
8686

8787
<!-- Test only dependencies -->
88-
<junit.version>4.13.1</junit.version>
88+
<junit.version>4.13.2</junit.version>
8989
<junit-jupiter.version>5.9.2</junit-jupiter.version>
90-
<mockito.version>3.6.28</mockito.version>
90+
<mockito.version>3.8.0</mockito.version>
9191
<assertj.version>3.18.1</assertj.version>
9292
<awaitility.version>4.0.3</awaitility.version>
9393
<hamcrest.version>1.3</hamcrest.version>

zipkin-server/src/main/java/zipkin2/server/internal/ZipkinGrpcCollector.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static final class SpanService extends AbstractUnsafeUnaryGrpcService {
5858
this.metrics = metrics;
5959
}
6060

61-
@Override protected CompletionStage<ByteBuf> handleMessage(ServiceRequestContext srCtx, ByteBuf bytes) {
61+
@Override protected CompletionStage<ByteBuf> handleMessage(ServiceRequestContext ctx, ByteBuf bytes) {
6262
metrics.incrementMessages();
6363
metrics.incrementBytes(bytes.readableBytes());
6464

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

6969
try {
7070
CompletableFutureCallback result = new CompletableFutureCallback();
71-
72-
// collector.accept might block so need to move off the event loop. We make sure the
73-
// callback is context aware to continue the trace.
74-
Executor executor = ServiceRequestContext.mapCurrent(
75-
ctx -> ctx.makeContextAware(ctx.blockingTaskExecutor()),
76-
CommonPools::blockingTaskExecutor);
77-
78-
collector.acceptSpans(bytes.nioBuffer(), SpanBytesDecoder.PROTO3, result, executor);
79-
71+
collector.acceptSpans(bytes.nioBuffer(), SpanBytesDecoder.PROTO3, result, ctx.blockingTaskExecutor());
8072
return result;
8173
} finally {
8274
bytes.release();

0 commit comments

Comments
 (0)