Fix memory leak in Zipkin API (#10126)

This commit is contained in:
kezhenxu94 2022-12-07 22:25:03 +08:00 committed by GitHub
parent 108260681e
commit 210c374976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -29,6 +29,7 @@
* Remove abandon logic in MergableBufferedData, which caused unexpected no-update.
* Fix miss set `LastUpdateTimestamp` that caused the metrics session to expire.
* Rename MAL rule `spring-sleuth.yaml` to `spring-micrometer.yaml`.
* Fix memory leak in Zipkin API.
#### UI

View File

@ -100,10 +100,11 @@ public class ZipkinSpanHTTPHandler {
final HttpRequest req) {
final HistogramMetrics.Timer timer = histogram.createTimer();
final HttpResponse response = HttpResponse.from(req.aggregate().thenApply(request -> {
final HttpData httpData = UnzippingBytesRequestConverter.convertRequest(ctx, request);
final List<Span> spanList = decoder.decodeList(httpData.byteBuf().nioBuffer());
spanForward.send(spanList);
return HttpResponse.of(HttpStatus.OK);
try (final HttpData httpData = UnzippingBytesRequestConverter.convertRequest(ctx, request)) {
final List<Span> spanList = decoder.decodeList(httpData.byteBuf().nioBuffer());
spanForward.send(spanList);
return HttpResponse.of(HttpStatus.OK);
}
}));
response.whenComplete().handle((unused, throwable) -> {
if (nonNull(throwable)) {