* Add test for #4803: Race condition in initialisationComplete flag
Add TestInitialisationComplete_RaceCondition to demonstrate the data race
that occurs when the initialisationComplete boolean flag is accessed
concurrently by multiple goroutines without synchronization.
The test simulates:
- Init goroutine writing to the flag
- Query executor reading via isInitialised()
- Notification handler reading the flag directly
This test will fail when run with the -race flag, exposing the bug.
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix#4803: Use atomic.Bool for initialisationComplete flag
Replace the plain boolean initialisationComplete field with atomic.Bool
to prevent data races when accessed concurrently by multiple goroutines.
Changes:
- Change field type from bool to atomic.Bool
- Use .Store(true) for writes
- Use .Load() for reads in isInitialised() and handleConnectionUpdateNotification()
- Update test to use atomic operations
The test now passes with -race flag, confirming the race condition is fixed.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add function to clear connection cache.
* Update FDW to v1.9.0 - Add ability to clear connection cache by inserting into settings table.
* Update plugin sdk to v5.6.1
* fix listen unit tests
- 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#3394Closes#3267