Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The function to mark a table initialized wrongly closed the channel immediately. This could cause an observer to be woken up too early (before Commit() has finished) and get an uninitialized snapshot. Fix the timing issue by moving the closing into Commit(), next to the normal watch channel closing. This way the initialized table has been committed before the init watch channel closes. This issue was detected by `pkg/k8s/statedb_test.go` in cilium/cilium: statedb_test.go:263: Error Trace: /home/runner/work/cilium/cilium/pkg/k8s/statedb_test.go:263 /home/runner/work/cilium/cilium/pkg/k8s/statedb_test.go:120 Error: Not equal: expected: "obj1" actual : "garbage" Diff: --- Expected +++ Actual @@ -1 +1 @@ -obj1 +garbage Test: TestStateDBReflector/default Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
- Loading branch information