adopt the tracing log facade, engine crates only (review 004 item 7's family-level decision, ADR-025): the family precedent checked and unanimous (alkcall/alktunnels/alksocks/alktty all on tracing = "0.1" facade-only, tracing-subscriber env-filter a dev-dep where present, silent by default); user sign-off taken in-session (2026-10-11, adopt-tracing option chosen) and recorded in the ADR's status; core stays dep- and emit-free (the explicit core-dep answer — the payload serde deps remain the sole core deps, the ADR states the ADR-020-§4 reading explicitly); all 19 library-path eprintln! sites migrated to tracing::warn!/error! with message text + the alkstore: prefix + the secret-free discipline unchanged (17 at review time, +2 from the review's own inline tick/lease restructures — re-grepped, sqlite 10 / pg 9, zero remainder, tests' harness-skip prints untouched); levels: warn = retried/degraded ops, error = unrecoverable loss (watcher death, discarded pooled clients, panic-path rollback failures); the four substrate-lineage files ride PROVENANCE delta D-41 (message-identical macro swap); deployment.md gains the diagnostics-posture section (operator recipe RUST_LOG=warn/error at the consuming binary; listener application_name diagnosability joins it), ADR index + design-decisions table carry the 025 row, CHANGELOG's 0.1.0 body states the facade; pg-fix-forwarder-diagnosability's output form now pinned (warn on failed reconnect connects with attempt/backoff context, error on the loop-exit poll error); gates green: build, workspace tests server-less, clippy -D warnings, fmt, doc gate zero warnings, fuzz corpus replay 6/6; task -> completed
This commit is contained in:
1 parent
ce5da852ca
commit
a9b6cf0c86
19 files changed
+332
-31
No files matched your search
@@ -16,6 +16,7 @@ serde_json = "1"
|
||||
thiserror = "2"
|
||||
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time"] }
|
||||
tokio-postgres = "0.7"
|
||||
tracing = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
alkstore-contract-suite = { path = "../alkstore-contract-suite" }
|
||||
|
||||
@@ -167,7 +167,7 @@ async fn bridge_loop(
|
||||
}
|
||||
}
|
||||
Err(tokio::sync::broadcast::error::RecvError::Lagged(n)) => {
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: listener subscriber on channel {channel:?} lagged, \
|
||||
skipped {n} notifications (recovery is the consumer's re-read)"
|
||||
);
|
||||
|
||||
@@ -488,7 +488,7 @@ impl Queue for PgQueueHandle {
|
||||
// net covers the gap — no wake may ever fail (or stall) a
|
||||
// committed enqueue.
|
||||
if let Err(wake_err) = conn.query_one("SELECT pg_notify($1, '')", &[&name]).await {
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: queue enqueue wake failed for {name:?} \
|
||||
(the durable row landed; the re-poll safety net covers the gap): {wake_err}"
|
||||
);
|
||||
|
||||
@@ -515,7 +515,7 @@ pub(crate) async fn tick(client: &tokio_postgres::Client, schema: &str, now: i64
|
||||
let interval = match parse_every_interval(&row.spec) {
|
||||
Ok(interval) => interval,
|
||||
Err(bad) => {
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: schedule {name:?} spec {spec:?} failed to re-parse ({bad}) \
|
||||
— quarantining: boundary advanced past now, schedule skipped until \
|
||||
the stored spec is repaired or removed",
|
||||
@@ -780,7 +780,7 @@ async fn tick_with_retries(
|
||||
Err(e) if retries < TICK_RETRIES => {
|
||||
retries += 1;
|
||||
let delay = tick_retry_backoff(retries);
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: scheduler tick failed (retry {retries}/{TICK_RETRIES} \
|
||||
after {delay:?}): {e:?}"
|
||||
);
|
||||
@@ -905,7 +905,7 @@ impl Outbox for PgOutboxHandle {
|
||||
.query_one("SELECT pg_notify($1, '')", &[&backing])
|
||||
.await
|
||||
{
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: outbox enqueue wake failed for {backing:?} \
|
||||
(the durable row landed; the re-poll safety net covers the gap): {wake_err}"
|
||||
);
|
||||
|
||||
@@ -294,7 +294,7 @@ fn publish_with_key(
|
||||
// the durable row landed; no wake fee may ever fail (or
|
||||
// stall) a publish.
|
||||
if let Err(wake_err) = conn.query_one("SELECT pg_notify($1, '')", &[&stream]).await {
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: stream publish wake failed for {stream:?} \
|
||||
(the durable row landed; readers re-drain on their next hint): {wake_err}"
|
||||
);
|
||||
@@ -653,7 +653,7 @@ async fn wait_wake(
|
||||
Ok(_raw) => WakeTick::Ok,
|
||||
Err(tokio::sync::broadcast::error::RecvError::Lagged(n)) => {
|
||||
// Still surfaced — treat like a wake: re-drain.
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: stream bridge on {stream:?} lagged the wake feed, \
|
||||
{n} notifications skipped (recovery is the re-drain)"
|
||||
);
|
||||
|
||||
@@ -294,7 +294,7 @@ pub(crate) async fn wake_tx(client: &tokio_postgres::Client, channel: &str) {
|
||||
.query_one("SELECT pg_notify($1, '')", &[&channel])
|
||||
.await
|
||||
{
|
||||
eprintln!(
|
||||
tracing::warn!(
|
||||
"alkstore-postgres: tx wake failed for {channel:?} \
|
||||
(best-effort: the durable row lands at the caller's commit): {wake_err}"
|
||||
);
|
||||
@@ -669,7 +669,7 @@ impl Drop for PgTxHandle {
|
||||
let client: &tokio_postgres::Client = &object;
|
||||
if let Err(e) = client.batch_execute("ROLLBACK").await {
|
||||
drop(Object::take(object));
|
||||
eprintln!(
|
||||
tracing::error!(
|
||||
"alkstore: pg tx handle dropped with a failed ROLLBACK; \
|
||||
the pooled client is discarded (state unknowable): {e}"
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user