Files
steampipe/pkg/query
Nathan Wallace cf47ffb77e Fix StreamRow/Close race condition with atomic coordination
Fixes issue #4790 where StreamRow() could panic with "send on closed
channel" when called concurrently with Close().

Solution:
- Added atomic.Bool closed flag to track Result state
- StreamRow() checks closed flag before sending to prevent most races
- Added defer/recover to gracefully handle edge case where Close()
  occurs between check and send
- Rows sent after close are silently dropped (safe behavior)

This approach avoids deadlocks by not holding locks during channel
send operations, while using atomic operations for coordination.

Test now passes consistently without panics.

Fixes #4790

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 16:22:01 -05:00
..