[Bug] Missing stream.Close() in processStreamingOutput causes potential resource leaks
Author: uschenCreated Feb 7, 2026Updated Feb 19, 2026
LabelsBug
Hi team,
While this works perfectly for the CLI use case, Close() isn't called on the event stream. The SDK documentation notes this is required to clean up the underlying reader/writer.
If customers copy this snippet into a long-running web server (instead of a CLI), it will leak goroutines. Adding a defer stream.Close() would make this safe for copy-pasting into production apps.
Source: awsdocs/aws-doc-sdk-examples