Skip to content

Tags: GoodNotes/dd-trace-java

Tags

v1.60.0-goodnotes-1

Toggle v1.60.0-goodnotes-1's commit message

Verified

This commit was signed with the committer’s verified signature.
gtukmachev Grigory Tukmachev
Fix Netty HTTP span lifecycle for chunked/streaming responses

The original HttpServerResponseTracingHandler had a single dispatch branch
that always closed the span when HttpResponse (headers) was written.
LastHttpContent — the actual end of a chunked stream — was silently passed
through with no span involvement, causing near-zero latency in APM for any
streaming/chunked response.

Two bugs fixed:

Bug 1 — span always closed on HttpResponse, no LastHttpContent handling.
Added explicit routing for all four Netty message types:
  - FullHttpResponse  → finish span immediately (checked FIRST: extends both
                        LastHttpContent and HttpResponse)
  - HttpResponse      → chunked headers only; save context, don't finish span
  - LastHttpContent   → finish span here to capture full streaming duration
  - HttpContent       → intermediate chunk; pass through

Bug 2 — keep-alive race condition.
Under HTTP keep-alive, channelRead for the next request can overwrite
CONTEXT_ATTRIBUTE_KEY before the pending LastHttpContent write task runs,
causing handleLastHttpContent to finish the wrong span (~1-chunk duration).
Fix: STREAMING_CONTEXT_KEY, a separate channel attribute set at chunked
header time and consumed (getAndRemove) by LastHttpContent — immune to
overwrite by the next request's span.

Verified: concurrent load test (48 requests, 8 threads):
  streaming/slow → ~5020ms, streaming/fast → ~61ms in DataDog APM. No outliers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

v1.59.0

Toggle v1.59.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jandro996 Alejandro González García
Release v1.59.0

v1.58.2

Toggle v1.58.2's commit message

Verified

This tag was signed with the committer’s verified signature.
dougqh Douglas Q Hawkins
Release v1.58.2

v1.58.1

Toggle v1.58.1's commit message

Verified

This tag was signed with the committer’s verified signature.
amarziali Andrea Marziali
Release v1.58.1

v1.58.0

Toggle v1.58.0's commit message

Verified

This tag was signed with the committer’s verified signature.
mcculls Stuart McCulloch
Release v1.58.0

v1.57.0

Toggle v1.57.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jpbempel Jean-Philippe Bempel
Release v1.57.0

v1.56.3

Toggle v1.56.3's commit message

Verified

This tag was signed with the committer’s verified signature.
jbachorik Jaroslav Bachorik
Release v1.56.3

v1.56.2

Toggle v1.56.2's commit message

Verified

This tag was signed with the committer’s verified signature.
piochelepiotr Piotr WOLSKI
Release v1.56.2

v1.56.1

Toggle v1.56.1's commit message

Verified

This tag was signed with the committer’s verified signature.
mcculls Stuart McCulloch
Release v1.56.1

v1.56.0

Toggle v1.56.0's commit message

Verified

This tag was signed with the committer’s verified signature.
PerfectSlayer Bruce Bujon
Release v1.56.0