Hardcoded Zero in Append-Only Log Silently Masqueraded as Real Measurement
A developer discovered that a log entry reading 'OK_ATOMS atoms=0 top=0 bot=0' was never a real measurement — it was a string literal written as a placeholder while the actual counter was still being built. Because zero is a legitimate result in real runs, the hardcoded line was indistinguishable from genuine output, allowing it to pass unnoticed through parsers and downstream systems. The append-only nature of the log meant the false record could not be deleted, requiring a superseding entry to correct it. The author argues that any log line resembling a measurement must actually originate from one, and suggests using an unambiguous error or a non-numeric sentinel value like 'reason=census_not_wired' as a placeholder instead. A simple audit — checking for log print statements whose numeric fields are literals rather than variables — can help identify lines that will never reflect real changes in underlying data.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in