Fix non-UTC timestamp crash; harden ingestion against per-item failures #12
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/timestamp-offsets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Fixes the crash Hannah hit the moment real SWAG traffic reached the deployed stack, plus the resilience gap it exposed.
The crash: nginx log timestamps carry the server's local offset (
[25/Aug/2026:17:15:00 -0500]); the parser faithfully preserves it; Npgsql rejects any non-zero-offsetDateTimeOffsetfortimestamptz; theeventsINSERT threw on the first real datagram.The deeper defect: that exception escaped
IngestionWorker, and the host's defaultBackgroundServiceExceptionBehavior.StopHosttook down the entire pipeline: a single poisoned datagram was a crash-loop primitive, violating the "malformed input must never crash ingestion" requirement.Changes:
DateTimeOffsetto UTC in the ToRow direction (12 fields across all row types). The instant is preserved exactly; only the representation changes. Read-side values come back from Postgres as UTC, which round-trips equal.IngestionWorkercatches per-item failures: logs, best-effort audits the failure, and keeps consuming the source. Correlation/classification/policy workers already had per-item catch+abandon; ingestion was the only unprotected stage.-05:00offset and assert UTC-offset rows preserving the instant.Fixes #
How was this tested?
dotnet build Viegard.slnx- 0 errors, 0 warningsdotnet test Viegard.slnx- 263/263 pass (3 new regression tests)git pull && docker compose up -d --build, then re-drive SWAG traffic and confirm events/incidents accumulate without pipeline restarts (Hannah)Checklist