mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
* Add test for #4792: customSearchPath data race This test demonstrates the data race on the customSearchPath slice when accessed concurrently from multiple goroutines without synchronization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix #4792: Add mutex protection for customSearchPath slice The customSearchPath slice was being accessed concurrently from multiple goroutines without synchronization, causing data races. This fix adds a dedicated mutex (searchPathMutex) to protect all reads and writes to the customSearchPath and searchPathPrefix fields. Changes: - Added searchPathMutex field to DbClient struct - Initialize searchPathMutex in NewDbClient constructor - Protected all customSearchPath writes in SetRequiredSessionSearchPath - Protected all customSearchPath reads in GetRequiredSessionSearchPath - Protected all customSearchPath reads in GetCustomSearchPath - Fixed logging in ensureSessionSearchPath to use already-fetched value - Updated test to initialize searchPathMutex for proper testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>