mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-23 21:09:15 -05:00
* Add tests demonstrating bug #4793: Close() sets sessions=nil without mutex These tests demonstrate the race condition where Close() sets c.sessions to nil without holding the mutex, while AcquireSession() tries to access the map with the mutex held. Running with -race detects the data race and the test panics with "assignment to entry in nil map". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix #4793: Protect sessions map access with mutex in Close() Acquire sessionsMutex before setting sessions to nil in Close() to prevent data race with AcquireSession(). Also add nil check in AcquireSession() to handle the case where Close() has been called. This prevents the panic "assignment to entry in nil map" when Close() and AcquireSession() are called concurrently. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
3.2 KiB
3.2 KiB