Azure / eno

Language-agnostic configuration management for Kubernetes
MIT License
7 stars 5 forks source link

Shuffle correctly #169

Closed jveski closed 4 months ago

jveski commented 4 months ago

We don't shuffle lists correctly. Strangely enough this only actually matters in one case: the watch controller.

The watch controller watches synthesizers and spawns "kind watch" controllers for each kind they reference. Once things converge the loop will drop its work item and wait for something to change. Because synthesizers rarely change, dropping the work item when it shouldn't be is a 100% chance of deadlock.

The way in which we shuffle incorrectly sometimes causes elements to be represented in the slice multiple times. So if there are three synthesizers, one of which is not yet in sync, but only the other two are represented in the slice, everything is in sync from the controller's perspective.

Most controllers recover from this quickly enough since compositions are chatty during synthesis. But the watch controller is unlikely to recover until the controllers are rolled.