elotl / kip

Virtual-kubelet provider running pods in cloud instances
Apache License 2.0
223 stars 14 forks source link

Use Timers instead of Tickers in pod_controller's ControlLoop #65

Open justnoise opened 4 years ago

justnoise commented 4 years ago

The control loop for the PodController has a lot of cases with multiple tickers that can fire. Some of the ticker case statements could take seconds to run under very heavy loads and there are two tickers that run frequently (controlTicker and statusTicker) If one of the cases blocks is slow to run, that case could run repeatedly, starving other cases from running. That would be bad.

Lets switch to using Timers instead of tickers and reset the timer at the end of each case. For a sample of using Timers instead of Tickers, check virtual-kubelet's NodeController.controlLoop