Skip to content

Report the shutdown from the batch loop, not the signal handler - #151

Merged
lukashes merged 1 commit into
mainfrom
bugfix/signal-handler-logging
Aug 11, 2026
Merged

Report the shutdown from the batch loop, not the signal handler#151
lukashes merged 1 commit into
mainfrom
bugfix/signal-handler-logging

Conversation

@lukashes

Copy link
Copy Markdown
Owner

handleShutdownSignal logs from the signal handler. The handler runs on whatever
thread the signal interrupts, so the log rebinds the shared stderr writer under a
call already formatting into it, splitting that line, and it waits on the stderr
lock for as long as a write to stderr takes.

  • Keep only the atomic store in the handler.
  • Report the shutdown from the batch loop in Processor.run, where the flag is observed.

Closes #83.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Current run is the minimum over 3 passes, compared against the base branch (main @ c445d8a), built on the same runner.

Benchmark Baseline Current Δ Time Allocs Status
Converter DELETE 146.11μs 147.60μs +1.0% 13 → 13 ➡️
Converter INSERT 146.14μs 148.40μs +1.5% 13 → 13 ➡️
Converter UPDATE 176.03μs 176.14μs +0.1% 22 → 22 ➡️
JsonSerializer 50.89μs 51.46μs +1.1% 3 → 3 ➡️
KafkaProducer produce 249.10μs 246.86μs -0.9% 1 → 1 ➡️
KafkaProducer send 286.49μs 261.38μs -8.8% 0 → 0 🟢 faster
PgOutputDecoder 98.43μs 98.97μs +0.5% 6 → 6 ➡️
getPartitionKeyValue boolean 16.23μs 16.23μs +0.0% 1 → 1 ➡️
getPartitionKeyValue integer 0.04μs 0.04μs +0.0% 0 → 0 ⚪ noise
getPartitionKeyValue not found 0.03μs 0.03μs +0.0% 0 → 0 ⚪ noise
getPartitionKeyValue string 17.93μs 18.15μs +1.2% 1 → 1 ➡️
matchStreams found 18.03μs 18.01μs -0.1% 1 → 1 ➡️
matchStreams not found 0.06μs 0.06μs +1.8% 0 → 0 ⚪ noise

Summary: 🟢 1 faster · ➡️ 9 neutral · ⚪ 3 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
lukashes merged commit 03765bf into main Aug 11, 2026
7 checks passed
@lukashes
lukashes deleted the bugfix/signal-handler-logging branch August 11, 2026 04:06
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.

Shutdown signal handler calls std.log (not async-signal-safe)

1 participant