Skip to content

Commit 6e2e088

Browse files
RoyLinRoyLin
authored andcommitted
release: v0.2.4 — SIGTERM clean shutdown (k8s lifecycle)
Handle SIGTERM alongside SIGINT so a k8s DaemonSet pod shuts down cleanly (exit 0) on termination instead of being SIGKILLed after the grace period; flush a final throughput report on exit. Validated on KVM: SIGTERM -> exit 0 + 'stopped (final window)' log.
1 parent 1bb25eb commit 6e2e088

7 files changed

Lines changed: 26 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to a3s-observer will be documented in this file.
44

5+
## [0.2.4] — clean shutdown (k8s lifecycle)
6+
7+
### Changed
8+
9+
- Handle **SIGTERM** (not just SIGINT) so a Kubernetes DaemonSet pod shuts down cleanly on
10+
termination instead of being SIGKILLed after the grace period; flush a final throughput
11+
report on exit. Validated on KVM: SIGTERM → exit 0 + final-window log.
12+
513
## [0.2.3] — data-loss visibility
614

715
### Added

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-observer"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
license = "MIT"
66
description = "General-purpose, language-agnostic eBPF observability for AI agents (LLM calls, tools, files, network egress)."

a3s-observer-collector/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-observer-collector"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
license = "MIT"
66
description = "a3s-observer collector: loads the eBPF probes and exports enriched events."

a3s-observer-collector/src/main.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ async fn main() -> anyhow::Result<()> {
113113
);
114114

115115
let mut sigint = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::interrupt())?;
116+
let mut sigterm = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())?;
116117
let mut stats = Stats::default();
117118
let mut report = tokio::time::interval(Duration::from_secs(60));
118119
report.tick().await; // consume the immediate first tick
119120
loop {
120121
tokio::select! {
121122
_ = sigint.recv() => break,
123+
_ = sigterm.recv() => break, // k8s sends SIGTERM on pod termination
122124
_ = report.tick() => {
123125
let dropped: u64 = drops
124126
.get(&0, 0)
@@ -259,7 +261,14 @@ async fn main() -> anyhow::Result<()> {
259261
}
260262
}
261263
}
262-
tracing::info!("a3s-observer-collector: stopped");
264+
tracing::info!(
265+
exec = stats.exec,
266+
egress = stats.egress,
267+
dns = stats.dns,
268+
file = stats.file,
269+
llm = stats.llm,
270+
"a3s-observer-collector: stopped (final window)"
271+
);
263272
Ok(())
264273
}
265274

a3s-observer-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-observer-common"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
license = "MIT"
66
description = "Shared no_std types crossing the eBPF <-> userspace boundary for a3s-observer."

a3s-observer-ebpf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-observer-ebpf"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
license = "MIT"
66
publish = false

0 commit comments

Comments
 (0)