kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.67k stars 333 forks source link

fix(kuma-cp): unnecessary `failed to write error to closed channel` errors #12059

Closed lobkovilya closed 1 day ago

lobkovilya commented 6 days ago

Motivation

Error channel had capacity 0, that's why every time when we write to it like:

select {
case errChan <- err:
default:
    log.Error(err, "failed to write error to closed channel")
}

we always go to the default section.

Implementation information

Update channel capacity to be 1.

Supporting documentation

None

lobkovilya commented 6 days ago

I checked more carefully, we don't need errCh in callbacks at all, should be simpler now. It should be clear now that capacity 1 is enough