Repository navigation
Commit abbe49d
profiling(ddprof): fix two reapply ordering bugs found by PR review bots
- setContextValue: a rejected native write (e.g. >255-byte UTF-8) clears the
native slot but left the Java snapshot untouched, so the attribute read as
unset until the next span boundary silently resurrected the stale prior
value. Reapply immediately on rejection so the prior value stays visible
continuously, matching pre-migration DBB behavior.
- setTraceContext: reapplyAppContext() ran unconditionally after the native
call, so when profiling.context.attributes also names
_dd.trace.operation/resource (with span-name/resource-name context
enabled), the trailing reapply clobbered the span-derived value that
setTraceContext just wrote to the same offset with a stale app-recorded
one. reapplyAppContext now takes the operation/resource offsets to skip.
Both were flagged independently by Codex and Datadog Autotest PR review bots
on #11899, with a concrete repro for the first. Added regression coverage to
DatadogProfilerTest#testContextRegistration for both (verified each new
assertion fails without its corresponding fix).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 0bac29b commit abbe49d
2 files changed
Lines changed: 70 additions & 1 deletion
File tree
- dd-java-agent/agent-profiling/profiling-ddprof/src
- main/java/com/datadog/profiling/ddprof
- test/java/com/datadog/profiling/ddprof
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
528 | 532 | | |
529 | 533 | | |
530 | 534 | | |
| |||
555 | 559 | | |
556 | 560 | | |
557 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
558 | 566 | | |
559 | 567 | | |
560 | 568 | | |
| |||
615 | 623 | | |
616 | 624 | | |
617 | 625 | | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
618 | 636 | | |
619 | 637 | | |
620 | 638 | | |
| |||
625 | 643 | | |
626 | 644 | | |
627 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
628 | 649 | | |
629 | 650 | | |
630 | 651 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
481 | 529 | | |
482 | 530 | | |
483 | 531 | | |
| |||
0 commit comments