steve/pkg/sqlcache/informer
Alejandro Ruiz 287428701b
Avoid Watches using write transactions (#840)
* Avoid Watches using write transactions

* Prevent duplicated events

By stopping the backfilling once it reaches the latest ResourceVersion at the moment the watcher was registered

* Move function

* Add comment

* Close channel after removing the watcher

* Remove unnecessary case

* Take derived context into account

* Remove unnecessary case

* Properly wait for goroutine to finish before returning from Watch

This prevents a panic trying to write to the original eventsChan if it was closed

* Simplify buffler flush section

* Parameterize maxBufferSize

* Refactor into a single goroutine

* Split goroutine into 3 different loops for readability

* Release queue for GC once no longer needed

* Change order of primary key for _events tables
2025-10-21 20:08:10 -04:00
..
factory Capture type info so numeric values sort correctly. (#837) 2025-10-15 10:40:55 -07:00
db_mocks_test.go
dynamic_mocks_test.go
indexer.go
indexer_test.go
informer.go Capture type info so numeric values sort correctly. (#837) 2025-10-15 10:40:55 -07:00
informer_mocks_test.go
informer_test.go Capture type info so numeric values sort correctly. (#837) 2025-10-15 10:40:55 -07:00
listoption_indexer.go Avoid Watches using write transactions (#840) 2025-10-21 20:08:10 -04:00
listoption_indexer_test.go Avoid Watches using write transactions (#840) 2025-10-21 20:08:10 -04:00
shared_informer_hack.go
shared_informer_test.go
sql_mocks_test.go
synthetic_watcher.go
synthetic_watcher_test.go