Repository navigation
Conversation
Base64Decoding (internal-api) returns null for invalid input instead of throwing. Input whose length or trailing padding can't be valid Base64 is rejected before calling the JDK decoder; anything else is decoded with Base64.getDecoder(). Propagation and message call sites (Data Streams pathway context, SQS and Spring Messaging _datadog attributes, Kafka header decoding, Lambda event bodies, Spark) now check for null and skip invalid values instead of catching an exception. Data Streams also ignores pathway contexts longer than any valid encoding or too short to hold one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compares Base64Decoding against the pattern it replaces at call sites, Base64.getDecoder() with a catch that returns null, for valid and invalid input at two stack depths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
Static inspection supports compatibility for valid padded and unpadded Base64, with malformed values handled through the migrated callers’ null checks. The specialist reported no actionable regressions.
🤖 Bits Code Review · Commit 6e1dac7
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
What Does This Do
Base64 values the tracer reads from propagation headers, message attributes and event payloads are validated before decoding, and invalid values are skipped without throwing an exception. Data Streams pathway contexts longer than any valid encoding, or too short to hold one, are ignored. Valid values decode exactly as before.
Motivation
The tracer decodes Base64 in several propagation and messaging paths, each calling the JDK decoder directly and catching
IllegalArgumentExceptionfor malformed input. A shared helper gives these paths consistent validation, lets them handle bad input without exceptions, and gives future decode sites one API to use.Performance
Base64DecodingBenchmark(added in this PR) comparesBase64Decoding.decode()with the pattern it replaces at call sites:Base64.getDecoder().decode()with a catch that returnsnull.depthadds stack frames above the decode, since the cost of an exception grows with the stack it captures. The depth-64 rows include about 35–40 ns of recursion overhead on both sides.Apple M1 Max (arm64), JDK 21.0.4 (Zulu), JMH 1.37, 2 forks, 3×1s warmup, 5×1s measurement:
./gradlew :internal-api:jmh -PtestJvm=21 -Pjmh.includes=Base64DecodingBenchmark -Pjmh.profilers=gcbadLengthbadLengthbadCharbadCharvalidvalidvalidLargevalidLargeLonger runs on x86 are in progress and will be added here.
Additional Notes
Base64Decoding(internal-api) hasdecodeoverloads forbyte[],StringandByteBuffer, each returningnullfor invalid input. Input whose length or trailing padding can't be valid Base64 is rejected without calling the JDK decoder; anything else is decoded withBase64.getDecoder().DatadogAttributeParser, both KafkaTextMapExtractAdapters,Functions.BASE64_DECODE, Lambda event and response bodies, and Spark. Each now checks fornullinstead of catching.Base64.Decoderfield became a boolean flag, with no behavior change.🤖 Generated with Claude Code