# The Tale of a Go Resource Leak

DevFeed: [The Tale of a Go Resource Leak](<https://devfeed.tech/articles/always-be-closing-15495.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/always-be-closing>)

Author: Alec Holmes

Published: 2017-07-11T19:31:01Z

Content type: article

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [bug](<https://devfeed.tech/topics/bug.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [garbage-collection](<https://devfeed.tech/tags/garbage-collection.md>), [go](<https://devfeed.tech/tags/go.md>), [leak](<https://devfeed.tech/tags/leak.md>), [memory](<https://devfeed.tech/tags/memory.md>)

## AI overview

A Square Go service developed sharply higher memory and CPU use after bugs caused per-request metadata to be retained for almost 17 hours. The investigation traced the issue to uncanceled Go contexts in an internal request-handling framework, combined with a client timeout misconfiguration.

## Source excerpt

The Tale of a Go Resource Leak