Skip to content

Add a debug_logs build flag and teardown tracing#94

Merged
lukashes merged 1 commit into
bugfix/replication-conn-data-racefrom
chore/debug-log-tracing
Jul 12, 2026
Merged

Add a debug_logs build flag and teardown tracing#94
lukashes merged 1 commit into
bugfix/replication-conn-data-racefrom
chore/debug-log-tracing

Conversation

@lukashes

Copy link
Copy Markdown
Owner

Stacked on #92 (base is bugfix/replication-conn-data-race); retarget to main once #92 merges. The teardown traces sit on top of #92's shutdown code, so this cannot branch cleanly off main.

What

  • New -Ddebug_logs build option: raises the log level so std.log.debug is compiled in. Default off, so Release/prod output stays clean. Wired through build_options into std_options.
  • The load stand Dockerfile builds with -Ddebug_logs=true (keeps ReleaseFast perf, gains the traces).
  • Debug traces along the shutdown path: produce-failed propagation, the flush worker cancel, and processor/producer deinit. These pinpointed the metrics-server teardown hang (fixed separately in Stop the metrics server on cancel, not just on graceful stop #93).
  • Drop the two per-message debug logs from the hot loop ("Sent message", "No matching streams") so turning debug on does not flood the output.

Why

std.log.debug was compiled out of the ReleaseFast load-stand build, so a hung teardown showed no detail. This makes the fail-fast path observable on the stand.

std.log.debug is compiled out of Release builds, so the load stand never
saw teardown or fail-fast detail. Add a -Dlog_level build option (err,
warn, info, debug; default info, so prod stays clean), wired through
build_options into std_options. The load stand Dockerfile builds with
-Dlog_level=debug.

Trace the shutdown path: produce-failed propagation, the flush worker
cancel, and processor/producer deinit. Drop the two per-message debug logs
from the hot loop so raising the level does not flood the output.
@lukashes lukashes force-pushed the chore/debug-log-tracing branch from b23c063 to de65923 Compare July 11, 2026 22:22
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Current run is the minimum over 3 passes, compared against the base branch (bugfix/replication-conn-data-race @ 0888c39), built on the same runner.

Benchmark Baseline Current Δ Time Allocs Status
Converter DELETE 128.14μs 127.19μs -0.7% 12 → 12 ➡️
Converter INSERT 122.27μs 121.76μs -0.4% 12 → 12 ➡️
Converter UPDATE 174.90μs 173.59μs -0.8% 21 → 21 ➡️
JsonSerializer 42.27μs 40.79μs -3.5% 3 → 3 ➡️
KafkaProducer produce 299.51μs 320.10μs +6.9% 1 → 1 🔴 slower
KafkaProducer sendMessage 389.48μs 392.06μs +0.7% 0 → 0 ➡️
PgOutputDecoder 92.88μs 94.07μs +1.3% 6 → 6 ➡️
getPartitionKeyValue boolean 16.74μs 16.63μs -0.6% 1 → 1 ➡️
getPartitionKeyValue integer 50.92μs 50.89μs -0.1% 3 → 3 ➡️
getPartitionKeyValue not found 0.03μs 0.03μs +0.0% 0 → 0 ⚪ noise
getPartitionKeyValue string 18.55μs 18.50μs -0.3% 1 → 1 ➡️
matchStreams found 17.82μs 17.73μs -0.5% 1 → 1 ➡️
matchStreams not found 0.05μs 0.05μs +0.0% 0 → 0 ⚪ noise

Summary: ➡️ 10 neutral · 🔴 1 slower · ⚪ 2 ignored (sub-μs)

Thresholds: <1μs ignore · 1–20μs 15% · 20–50μs 10% · ≥50μs 5%. Measured on a shared CI runner — treat small deltas as noise. Informational only; this check never fails the build.

@lukashes

Copy link
Copy Markdown
Owner Author

/bench

@lukashes lukashes merged commit 03d4d93 into bugfix/replication-conn-data-race Jul 12, 2026
@lukashes lukashes deleted the chore/debug-log-tracing branch July 12, 2026 06:32
@lukashes lukashes restored the chore/debug-log-tracing branch July 12, 2026 06:33
@lukashes lukashes deleted the chore/debug-log-tracing branch July 12, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant