grafana / beyla

eBPF-based autoinstrumentation of web applications and network metrics
https://grafana.com/oss/beyla-ebpf/
Apache License 2.0
1.19k stars 77 forks source link

Fix race conditions in kube database #773

Closed mariomac closed 3 weeks ago

mariomac commented 3 weeks ago

Fixes issue: https://github.com/grafana/beyla/issues/759

mariomac commented 3 weeks ago

@marctc I did it basically for performance reasons. The consistence of the database is not so important but just avoiding Go panicking for concurrent operations.

Having multiple mutexes would prevent that, for example, a Pod metadata read is not blocked because a containerID is blocked in another side.

But if you think the code is cumbersome, we might use only a single mutex and only consider using several if in the future we detect any performance issue.

marctc commented 3 weeks ago

But if you think the code is cumbersome, we might use only a single mutex and only consider using several if in the future we detect any performance issue.

No, I just wanted understand why. Thanks for clarifying!