metacontroller icon indicating copy to clipboard operation
metacontroller copied to clipboard

System rapidly making calls to sync hook

Open kevinjdolan opened this issue 4 years ago • 1 comments

I followed the guide here for building an example controller, using all of the provided sources and commands: https://metacontroller.app/guide/create/

I am working on a fairly fresh cluster running 1.15.9-gke.22 in GKE.

According to these docs, https://metacontroller.app/api/compositecontroller/, the following quote:

By default, your sync hook will only be called when something changes in one of the resources you’re watching, or when the local cache is flushed.

Because no resync period is defined for the controller in the example, my expectation would be that the sync hook would only be called once. However, I am seeing it called approximately once per second.

Running kubectl -n hello describe helloworld your-name, I see the following fields changing:

  • Metadata / Generation
  • Metadata / Resource Version
  • Status / Observed Generation

Looking at the logs for metacontroller, it doesn't seem like it is actually sending updates to the children resources unless the output actually changes.

I am concerned for performance reasons about the frequent calls to sync. My expectation is that the resyncPeriodSeconds paramater, as well as the resyncAfterSeconds response parameter could be used to tune the performance of these items; but I am suspicious that there is a problem with the implementation since these parameters seem to be ignored.

kevinjdolan avatar Mar 25 '20 23:03 kevinjdolan

Ran into this too... Looks like the solution is to add a status sub-resource as mentioned here.

saip92 avatar Apr 05 '20 16:04 saip92