Skip to content

Commit b66e082

Browse files
committed
Avoid recycling transactions twice (#205)
closes #178
1 parent 6b6e430 commit b66e082

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apm-agent-core/src/main/java/co/elastic/apm/report/ApmServerHttpPayloadSender.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public void writeTo(BufferedSink sink) throws IOException {
8787
payloadSerializer.serializePayload(os, payload);
8888
} finally {
8989
os.close();
90-
payload.recycle();
9190
}
9291
}
9392
})
@@ -109,6 +108,8 @@ public void writeTo(BufferedSink sink) throws IOException {
109108
} catch (IOException e) {
110109
logger.debug("Sending payload to APM server failed", e);
111110
dropped += payload.getPayloadObjects().size();
111+
} finally {
112+
payload.recycle();
112113
}
113114
}
114115

0 commit comments

Comments
 (0)