You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg/cvo/sync_worker.go: Fix panic caused by data race
The bug is explained in more detail in the commit that is responsible
for testing the bug's behavior. For more information, see the commit
7f9cf62
This commit will fix the issue by introducing a new channel to
exclusively signal the start of the initial attempt of the application
after the `SyncWorker.Update()` has finished. It may also be used for
any consecutive signals to attempt an application. This ensures the
`Update()` has finished at least once before we attempt to apply the
payload.
A new local channel is added to the `Start()` method to not cause a
potential deadlock. The `Start()` method is the sole consumer of the
`notify` and `startApply` channels. In a potential scenario, the
`Start()` goroutine may consume an element from one of the channels and
get starved. The goroutine would not be able to produce the element
back into the channel and break out of the loop, because the channel
could already be full. This would create a deadlock as there wouldn't be
any consumers of the channels. An alternative is to utilize other Go
structs; however, using channels requires minimal changes to the
present code.
0 commit comments