argoproj / gitops-engine

Democratizing GitOps
https://pkg.go.dev/github.com/argoproj/gitops-engine?tab=subdirectories
Apache License 2.0
1.7k stars 265 forks source link

Optimize locking when processing events #602

Closed andrii-korotkov-verkada closed 4 months ago

andrii-korotkov-verkada commented 4 months ago

Sometimes it takes a while until Kubernetes event is received or processed. It could be partially related to using locks when processing events. They can be optimized to use read locks sometimes.

andrii-korotkov-verkada commented 4 months ago

See more details about the complex issue that this tries to help with here https://github.com/argoproj/argo-cd/issues/18500.

andrii-korotkov-verkada commented 4 months ago

Seems like this helps a lot! https://github.com/argoproj/gitops-engine/pull/603#issuecomment-2212620560

andrii-korotkov-verkada commented 4 months ago

The testing was misleading and it actually less locking time from faster iterate hierarchy v2 that is a problem solver. A bunch of benchmarking for the lock change shows neutral-to-regression results.