Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ fn printStatus(comptime fmt: []const u8, args: anytype) void {
};
}

// Only the atomic store: a log here would rebind the shared stderr writer under
// the interrupted call and can block on the stderr lock. The batch loop reports it.
fn handleShutdownSignal(_: posix.SIG) callconv(.c) void {
shutdown_requested.store(true, .seq_cst);
std.log.info("Shutdown signal received, initiating graceful shutdown...", .{});
}

fn setupSignalHandlers() void {
Expand Down
3 changes: 3 additions & 0 deletions src/processor/processor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ pub const Processor = struct {
}
}

// The signal handler only sets the flag, so the acknowledgement comes from here.
std.log.info("Shutdown requested, finishing the process...", .{});

// Graceful stop: cancel and await the worker (runs its final flush/commit)
// before reporting the stream stopped.
flush_future.cancel(io);
Expand Down