afterdiff

Aftermarket Fixes Five Shadow Mode Bugs Found in Review

Aftermarket 0.10.1 is a fix release for aftermarket shadow, the live mode of AfterDiff that came out earlier today. A second reviewer went through it looking for ways to break its promises, and found five real bugs. None of them touched what clients get back from the primary. They were about what the candidate got and what the report said.

Here’s the list.

Stopping made the candidate look broken. On Ctrl-C, shadow waits a while for queued copies and then stops. Copies still waiting, or still on their way to the candidate, were cut off and then listed as candidate errors with the reason “cancelled”. The candidate hadn’t failed anything. They’re now counted as not compared because shadow stopped, which is what happened.

Gzip answers showed a header difference replay doesn’t. When the primary answered with gzip, shadow decoded the body but kept its Content-Encoding and compressed Content-Length. The HTTP client that calls the candidate drops both when it decodes, and replay sees both sides that way. So with --header Content-Length, shadow reported a difference replay didn’t. Now the primary’s answer is compared the way the client sees it.

The running report sat still. The report was only rewritten after a copy had been compared. With writes and no --include-writes, or a low --sample, the counts stayed at zero until stop. Now any traffic updates it, still at most once a second.

Some answers went missing from the counts. A when: block can pick answers by status or content type. A request that matched but got an answer outside those was dropped from every count, so the numbers didn’t add up to the requests served. It’s counted as outside when: now, as the docs said.

The candidate got a header the primary never sees. Go’s reverse proxy drops hop-by-hop headers on the way to the primary, Proxy-Authorization among them. That one is a credential meant for a proxy. Shadow still sent it on to the candidate. Now the candidate gets the same headers the primary got.

Each bug got a test that failed on 0.10.0 before the fix went in. The proxy safety checks record already passes, stalled uploads, early answers, odd clients and clients that leave, now also run through shadow with a candidate that misbehaves. The recorded results have 565 tests, all passing.

Download 0.10.1 from the download page. The shadow section of the AfterTest and AfterDiff reference has the updated details.