Check allocation of concurrency slots in haproxy
We have a finite number of per-ip concurrency slots in any haproxy stick-table. We need to ensure that we allocate them correctly and that we keep them consistent across changes to actions.
This patch addresses this as follows:
- prevent the user to be able to assign a concurrency slot directly
- ensure that any action that requires a concurrency slot has one
- ensure that we don't have more concurrency slots allocated than allowed
This approach has several limitations:
- concurrency slots are global. This means that we can't have different concurrency slots for different sites where one action might be enabled or not.
- handling of errors is not ideal. We should probably have a better way to handle errors when we can't allocate a concurrency slot. For now, it will just throw an exception when trying to write or simply to validate the changes.
- There is an hidden coupling between the conftool configuration and the haproxy configuration. While this is not ideal, it's a decent compromise if you account we have other places where we have similar coupling.