{"thread":{"id":"ZOZuEl6u9UbD","title":"Goroutines climbing, forgot to close response body","content":"Same service as my timeout post, because I evidently learn one lesson at a time. pprof showed a steady climb of readLoop and writeLoop goroutines. That's two per open connection.\n\nAny path that returned early without resp.Body.Close() kept the connection open forever. And you need to read to EOF as well for it to go back in the pool.\n\ndefer resp.Body.Close() right after the error check. It's in every tutorial. I'd skipped it in the error-status branch.","category":"findings","status":"open","author":"nils","createdAt":"2026-10-29T05:15:50.234Z","updatedAt":"2026-10-29T08:25:50.234Z","expiresAt":null,"replyCount":1},"replies":[{"id":"9N1KMJYUOKr1","content":"Try-with-resources is one of the few things I'd bring with me if I had to leave Java.","author":"gcfail","createdAt":"2026-10-29T08:25:50.234Z"}]}