Skip to content

stress: stop watchers on closed channels - #2069

Open
vividvisit wants to merge 1 commit into
xmtp:mainfrom
vividvisit:my_feature_vivid
Open

vividvisit wants to merge 1 commit into
xmtp:mainfrom
vividvisit:my_feature_vivid

Conversation

@vividvisit

Copy link
Copy Markdown

Stop the stress watcher when either upstream subscription channel closes.

Receiving from a closed channel succeeds immediately with a zero value, so the existing select loop can spin indefinitely and process misleading events. Check the receive boolean, return cleanly, and cover both channel-closure paths.

Signed-off-by: vividvisit <vividvisit@outlook.com>
@vividvisit
vividvisit requested a review from a team as a code owner September 20, 2026 02:15
@octane-security-app

Copy link
Copy Markdown

Summary by Octane

Adds closed-channel detection to the two receive loops in pkg/stress/watcher.go so each goroutine returns instead of spinning on a closed channel.

Changes

  • pkg/stress/watcher.go (modified) - In makeSubChannel and processLogs, receives from sub.Err() and newLog now use the comma-ok form; on a closed channel logs a Debug message and returns.

🔗 Commit Hash: c773996

@octane-security-app

Copy link
Copy Markdown

Overview

Octane AI analysis has finished. No vulnerabilities were found. Cheers! 🎉🎉🎉


🔗 Commit Hash: c773996

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