What users saw when the proxies started failing
Why the first suspect was an attack
The file that doubled in size
r0 visible to the user running the query, alongside the default database the query was meant to read. The query that listed feature columns did not filter by database name. As a result, every column came back twice, and the feature file more than doubled in row count.
The consumer of that file was Cloudflare's newer proxy, called FL2 and written in Rust. It preallocates memory for a fixed number of features as a performance choice. The limit was 200, and normal usage was around 60. The doubled file went over the limit, the code that loaded it returned an error, and the code that handled that error called unwrap(). In Rust, unwrap() crashes the thread when the result is an error, so the worker thread panicked and requests failed with 5xx. The older proxy, FL, failed differently. It did not crash, but it gave every request a bot score of zero. Customers with rules that block low-scoring traffic then saw legitimate visitors blocked.
On your own fleet, the first evidence is in the proxy's logs. Search the window around the error spike for panics and limit messages. The service name below is a placeholder, so adjust it to your setup:
BASH
# Read-only: look for crashes and limit errors in the last hour
journalctl -u your-proxy.service --since '1 hour ago' --no-pager | grep -iE 'panic|unwrap|limit|exceed|too many'TEXT
thread 'worker' panicked at src/features.rs:120:10:
called `Result::unwrap()` on an `Err` value: too many featureswc -l and wc -c give you the row count and byte size. sort file | uniq -d | head shows any duplicated rows. A file that suddenly has twice as many rows as yesterday, with every entry duplicated, points straight at the query or job that produced it rather than at the proxy code.
The limit itself is the other half of the comparison. It usually lives in the consumer's source code or startup config, not in the pipeline. Many teams only find it during an incident. Write down the number for every file your proxies load.
Stopping the bad file and restarting the proxies
- Stop the generator or the distribution job. If you only roll back the file, the next scheduled run will push the bad version again.
- Put a known-good version in place. This only works if you kept one, so your pipeline needs to retain the last version that loaded cleanly.
- Restart or reload consumers so they pick up the good file. Confirm on a few nodes that the error rate drops before you call it fixed.
Treating generated config like untrusted input
BASH
#!/bin/sh
# Refuse to publish a generated file that would break the consumer.
f="$1"
max_rows=200 # must match the consumer's hard limit
max_bytes=1048576 # illustrative example, set to your real limit
rows=(wc -l < "f")
bytes=(wc -c < "f")
dups=(sort "f" | uniq -d | wc -l)
if [ "rows" -gt "max_rows" ] || [ "bytes" -gt "max_bytes" ] || [ "$dups" -gt 0 ]; then
echo "reject: rows=rows bytes=bytes duplicates=$dups" >&2
exit 1
fimax_rows. If the consumer's limit changes and this number doesn't, the gate becomes useless. Where you can, read both values from one shared source. It also helps to alert when the row count jumps by a large ratio compared to the previous run, even if it is still under the limit. A sudden doubling is suspicious on its own.
On the consuming side, an oversized or malformed file should not crash the process. The safer behavior is usually to reject the new file, log it loudly, and keep serving with the previous version. For a feature like bot scoring, whether to fail open or fail closed is a trade-off you should decide deliberately, not something left to an unwrap(). Rolling the file out to a small set of nodes first also limits the blast radius. The internal article on blast radius patterns from Cloudflare's 2022 outage covers that side in more depth.
The practical habit to take away is this. When proxies fail across a fleet with no code change, list the generated files they load and when each one last changed. Compare the newest file's row count, size, and duplicates against the last good copy and against the consumer's limit. Then make sure the next bad file is rejected at publish time, and that a proxy given a bad file keeps running on the old one.