58 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
cea0a647cf Nil GlobalConfig causes panic in newRefreshConnectionState closes #4779 (#4899)
* Add test demonstrating nil GlobalConfig panic in newRefreshConnectionState

Test: TestRefreshConnectionState_ConnectionOrderEdgeCases
Demonstrates issue #4779 where nil GlobalConfig causes panic

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Add nil check for GlobalConfig in newRefreshConnectionState

Fixes #4779: nil GlobalConfig causes panic in newRefreshConnectionState

Changes:
- Add nil check for GlobalConfig in newRefreshConnectionState before SetUserSearchPath
- Add nil check in getDefaultSearchPath to handle nil GlobalConfig gracefully
- Test now passes instead of panicking with nil pointer dereference

🤖 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-17 03:57:59 -05:00
Nathan Wallace
7e27df2d44 Fix #4791: Use idiomatic for-range pattern for error channel closes #4791 (#4835)
* Add test demonstrating bug #4791: Goroutine leak in executeUpdateSetsInParallel

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4791: Use idiomatic for-range pattern for error channel

Replace the for-select-nil-check pattern with the idiomatic for-range
pattern when consuming from the error channel. The for-range pattern:
- Automatically exits when the channel is closed
- Doesn't require manual nil checks
- Is more maintainable and less error-prone
- Follows Go best practices for channel consumption

This eliminates the potential for goroutine leaks if the nil check
were accidentally removed or modified in future maintenance.

🤖 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 14:11:31 -05:00
Nathan Wallace
3cfbb59dc5 Fix type assertion panic in logRefreshConnectionResults closes #4807 (#4855)
* Add test for #4807: Potential type assertion panic in logRefreshConnectionResults

Fix test to verify panic is prevented, not expected

The test was written to expect a panic, but after the fix is applied,
the panic should NO LONGER occur. Updated the test to verify that:
1. No panic occurs when handling nil values
2. No panic occurs when handling wrong types
3. No panic occurs when handling nil cobra.Command pointers

This ensures the test passes after the fix is applied.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4807: Use safe type assertion in logRefreshConnectionResults

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-16 11:19:55 -05:00
Nathan Wallace
6f5b471fe0 Nil pool validation in newRefreshConnectionState closes #4778 (#4825)
* Add test demonstrating bug #4778 - nil pool causes panic

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

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4778: Add nil pool validation in newRefreshConnectionState

Add nil check immediately after retrieving pool from pluginManager
to prevent panic when pool is nil. This addresses the issue where
a nil pool would cause a segmentation fault when passed to
db_local.SetUserSearchPath().

The fix returns a descriptive error instead of panicking, allowing
calling code to handle the error gracefully.

🤖 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-15 19:11:10 -05:00
Nathan Wallace
e374540483 Context cancellation check in executeUpdateSetsInParallel closes #4806 (#4873)
* Add test for #4806: executeUpdateSetsInParallel context cancellation

* Fix #4806: Add context cancellation checks in executeUpdateSetsInParallel
2025-11-15 11:19:20 -05:00
Nathan Wallace
2e5f3fda97 Add comprehensive passing tests from bug hunting initiative (#4864) 2025-11-13 09:26:46 +08:00
Nathan Wallace
ca32de335c Fix #4757: Race condition in exemplarSchemaMap (#4774) 2025-11-11 17:31:58 +08: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
dde7c23ed5 rename Connection to SteampipeConnection
remove unneeded code
use CloudMetadata from pipe-fittings
2024-09-27 18:14:28 +05:30
kai
5fd5ae0740 timing broken 2024-09-27 18:14:28 +05:30
kai
e5b1927a63 tidy imports 2024-09-27 18:14:28 +05:30
kai
cb681c67cc compiles but needs testing 2024-09-27 18:14:28 +05:30
kai
ad9c461f07 tidy refs 2024-09-27 18:14:28 +05:30
kai
80ad514e1d steampipe compiles 2024-09-27 18:14:28 +05:30
kai
fd94b2e2ec working on it 2024-09-27 18:14:25 +05:30
kai
cd07bf20f1 working on it 2024-09-27 18:13:12 +05:30
kai
faead86d26 move stuff to pipe-fittings 2024-09-27 18:13:12 +05:30
kai
0336832e55 RefreshConnections will create a new connection if it is not in the search path. Closes #4353
Add logging to RefreshConnections
2024-08-19 15:56:50 +01:00
kaidaguerre
e6e9714e4c Update all ErrorAndWarnings function returns to pass by value, removing possibility of nil ErrorAndWarnings. Closes #3974 (#4212) 2024-03-21 11:46:10 +00:00
Binaek Sarkar
0387595c36 Update calls to go-kit.ListFiles with the new go-kit.ListFilesWithContext. Closes #3884 2024-01-08 11:45:29 +00:00
kaidaguerre
017d99683d Sset connection state to error if plugin load fails. Closes #4043 2023-12-22 15:40:25 +00:00
kaidaguerre
46ef6ec90a Add steampipe_plugin_column introspection table to internal schema. Closes #4003
(cherry picked from commit 12079986d5)
2023-11-29 12:55:21 +00:00
kaidaguerre
79b66fb9fa Move hcl_helpers and type_conversion package to go-kit. Closes #3962
(cherry picked from commit 737efa381b)
2023-11-29 12:55:13 +00:00
kaidaguerre
61718dfa76 Remove unnecessary transactions from ConnectionStateUpdater. Closes #3929 2023-09-28 18:03:19 +01:00
kaidaguerre
817cfbfca1 Deprecate steampipe connection state and replace with steampipe connection - update both tables in parallel. Closes #3908 2023-09-26 17:53:33 +01:00
kaidaguerre
235cbc2037 Connection watching fixes.
Fix ConnectionConfigMap.Diff  inconsistent usage of Plugin and PluginInstance. Closes #3895
Fix GetConnectionStateErrorSql returning invalid query with additional parameter. Closes #3896
Update FDW to v1.8.0-rc.11 - fix failure to load connection config when importing schema
2023-09-25 12:35:00 +01:00
kaidaguerre
6f051ea463 Do not add connections in error to plugin manager connection map. Closes #3893 2023-09-22 18:12:29 +01:00
kaidaguerre
79606c5bcd Rename internal introspection tables. Fix warning notifications from RefreshConnections. Improve error handlingh for config inconsistencies in conneciton and plugin config. Closes #3886 2023-09-22 16:02:41 +01:00
kaidaguerre
f232b14f06 Add support for multiple instances of the same plugin version to execute. Closes #3863 2023-09-18 15:39:17 +01:00
Binaek Sarkar
d32276a849 Removing comments referring to unplanned and completed issues. Closes #1301 2023-09-15 12:21:58 +01:00
kaidaguerre
7feb305fde Provide mechanism for plugin manager to send warnings back to CLI. Closes #3603 (#3835) 2023-09-13 15:34:15 +01:00
kaidaguerre
95fed2ed2a Key the rate limiter and plugin config maps by plugin image ref, not short name. Closes #3820 2023-09-11 15:56:35 +01:00
Binaek Sarkar
862fcf1b71 Fix stall in plugin manager shutdown. Closes #3817 2023-09-08 17:48:20 +01:00
kaidaguerre
f041597497 Add support for plugin connection config and options blocks. Add options and env var configuration of max memory. Closes #3807 2023-09-06 15:59:13 +01:00
kaidaguerre
2a86d08445 Add support to retrieve plugin rate limiter definitions and use to populate steampipe_rate_limiter table. Closes #3805 (#3803) 2023-09-06 13:28:22 +01:00
Binaek Sarkar
08b447a261 Differentiate between user and system queries using application name. Closes #3600 2023-08-25 16:50:27 +01:00
Puskar Basu
6aaf9bc5be Update 'sperr' import references. Closes #3748 2023-08-17 13:52:04 +05:30
kai
e5ac3eff06 Merge remote-tracking branch 'origin/main' 2023-08-11 15:30:15 +01:00
kaidaguerre
202cb68692 Add HCL support for defining rate limiters, with filewatching as per connection config. Closes #3746 2023-08-11 14:24:44 +01:00
kai
02654f8d4d Merge branch 'v0.20.x'
# Conflicts:
#	pkg/pluginmanager_service/plugin_manager.go
#	tests/acceptance/test_files/dynamic_schema.bats
2023-08-11 14:18:53 +01:00
Binaek Sarkar
d622017bba Fixes issue where db connections are not closed after sending postgres notification. Closes #3744 2023-08-11 15:53:54 +05:30
kaidaguerre
b06348757a Fix linting warnings
---------

Co-authored-by: Binaek Sarkar <binaek@turbot.com>
Co-authored-by: Puskar Basu <puskar@turbot.com>
2023-07-06 16:08:23 +01:00
kaidaguerre
43dd6c7a61 Refactor Plugin manager:remove support for plugins which do not support multiple connections, simplify startup.
If plugin process crashes, benchmark or dashboard runs can leave running plugin processes after shutdown. Fixes #3598
2023-06-21 16:18:49 +01:00
kaidaguerre
217b708e4d Delete dynamic schemas before updating to avoid a timing issue showing incorrect schema. Closes #3510 2023-06-01 17:07:32 +01:00
kaidaguerre
1816d8d381 Delete dynamic schemas before updating to avoid a timing issue showing incorrect schema. Closes #3510 2023-06-01 16:57:20 +01:00
kaidaguerre
136ab15b80 Ensure 'Ready' connections are set to 'Pending' state on startup. Fixes #3483 2023-05-31 14:10:25 +01:00
kaidaguerre
692f3e7c30 Ensure 'Ready' connections are set to 'Pending' state on startup. Fixes #3483 2023-05-31 14:09:20 +01:00