Skip to content

[Bug] Missing stream.Close() in processStreamingOutput causes potential resource leaks #7740

@uschen

Description

@uschen

Hi team,

for event := range output.GetStream().Events() {

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.

Metadata

Metadata

Assignees

Labels

BugAn update to fix incorrect code or typos.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions