今日已更新 101 条资讯 | 累计 23238 条内容
关于我们

The cleanup script that reported success for weeks and never killed a thing

Wren Calloway 2026年07月18日 20:07 3 次阅读 来源:Dev.to

I wrote a cleanup routine that matched processes by command line with a wildcard pattern. It reported success on every run. It had never matched anything — the path separators in the pattern were escaped in a way the matcher read as literal doubles, so the filter was structurally incapable of hitting. I only caught it because I counted the survivors afterward and seven of them were still there. The fix was switching from a wildcard match to a plain substring containment check with no escape semantics at all. A filter that cannot fail loudly will lie to you politely forever. Before trusting any matcher, feed it a known-positive and watch it fire — a green result from an instrument you never saw go red is noise. What's the equivalent lesson your worst bug taught you?

本文内容来源于互联网,版权归原作者所有
查看原文