Skip to content

Bound stream queue depth to prevent unbounded memory growth#42

Merged
otamachan merged 1 commit into
mainfrom
bound-stream-queue-depth
Apr 1, 2026
Merged

Bound stream queue depth to prevent unbounded memory growth#42
otamachan merged 1 commit into
mainfrom
bound-stream-queue-depth

Conversation

@otamachan

Copy link
Copy Markdown
Owner

No description provided.

TopicStream, GoalStream, and Channel queues grew without limit when
next() was not called fast enough, causing unbounded memory consumption.

- TopicStream: use QoS depth as max queue size
- GoalStream: accept max_depth via send_goal() (default kDefaultStreamDepth=10)
- Channel: accept max_depth in constructor (default kDefaultStreamDepth=10)

Oldest messages are dropped when the queue exceeds max_depth.
GoalStream preserves kComplete events to avoid losing final results.
@otamachan otamachan merged commit 704556f into main Apr 1, 2026
2 checks passed
@otamachan otamachan deleted the bound-stream-queue-depth branch April 1, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant