Commit Graph

16 Commits

Author SHA1 Message Date
Puskar Basu
3f4eaae1a8 Fix db client deadlocks with non-blocking cleanup and RW locks (#4918) 2025-12-16 21:19:27 +05:30
Nathan Wallace
189a1e38a2 Fix race condition on customSearchPath slice closes #4792 (#4837)
* 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>
2025-11-16 11:51:41 -05:00
Puskar Basu
e19d35c457 chore: update module to v2 and bump Go version to 1.24 (#4597) 2025-07-07 16:03:56 +05:30
Puskar Basu
da2f3ecc03 Upgrade to pipe-fittings v2, go-kit v1 (#4485) 2025-03-06 16:34:18 +05:30
kai
112647bae0 tidy 2024-10-15 11:44:13 +01:00
kai
cb681c67cc compiles but needs testing 2024-09-27 18:14:28 +05:30
Binaek Sarkar
08b447a261 Differentiate between user and system queries using application name. Closes #3600 2023-08-25 16:50:27 +01:00
Binaek Sarkar
a1caf53eeb Adds 'steampipe_server_settings' table populated with server settings data during service startup. Closes #3462 2023-06-21 13:23:14 +01:00
Binaek Sarkar
6d73804f3a Fixes issue where 'internal' would be added twice in the search_path if one is mentioned in the non default search path. Closes #3397 2023-05-17 15:19:45 +01:00
kaidaguerre
40804a3201 Execute RefreshConnections asyncronously and optimise for high connection count. Add connection_state table.
- Execute RefreshConnections asyncronously
- Add connection_state table to indicate the loading state of connections
- Optimise RefreshConnections by cloning connection schemas
- Add locking to ensure only a single instance of RefreshConnections runs
- Start executing queries without waiting for connections to load, add smart error handling to wait for required connection
- Optimise autocomplete for high connection count
- Autocomplete and inspect data available before all conections are refreshed
- Update file watcher to respond to CHMOD, so thaat it pickes up deletion of file contents

 Closes #3394
 Closes #3267
2023-05-10 09:05:08 +01:00
Binaek Sarkar
be36276fd8 Add deprecation warnings for connection.options "connection" and global terminal options. CLoses #3246 2023-03-23 14:43:06 +00:00
kaidaguerre
86246ed927 Only call RefreshConnections on service startup or after a file watching event. Closes #3229 2023-03-15 16:33:23 +00:00
kaidaguerre
4e13e4e6d1 When a plugin fails to load, remove connections for that plugin from the connection state file. Closes #3124 2023-02-17 18:01:49 +00:00
kaidaguerre
0e27f38202 Update workspace profile parsing to load options blocks. Include these options values in viper with correct precedence. Closes #2579 2022-10-24 13:58:50 +01:00
kaidaguerre
404dd35e21 Update database code to use pgx interface so we can leverage the connection pool hook functions to pre-warm connections. Closes #2422 (#2438)
* Provide feedback for failed prepared statements
* Move error functions to error_helpers
* Make maintenance client retriable
2022-10-05 12:38:57 +01:00
kaidaguerre
5193c70395 Restructure steampipe repo to use pkg folder. Closes #2204 2022-06-27 11:36:03 +01:00