AD4: Excessive time spent in utility loop, effect?

(Thanks for AppDaemon, ideal for me to make complex control scenario’s)

I’ve seen topics (for AD3 or earlier) on ‘Excessive time spent in utility loop’ issues. Because I did not find an AppDaemon 4 topic, I would like to understand this :

  • What is the effect of this warning?
  • Will it affect my other AppDaemon automations?
  • Will it affect home assistant?
  • Does it restart the app?

Background info:
I use a Xiaomi infrared remote and I am sending a couple of IR codes by calling the respective service from AppDaemon. I had some issues in that :blush: (which I think I have resolved now), but when I had them I got messages like these:
`2020-10-04 22:15:58.030040 INFO IRControl: Turning OFF amplifiers

2020-10-04 22:15:59.806066 WARNING AppDaemon: Excessive time spent in utility loop: 12184.0ms, 12184.0ms in check_app_updates(), 0.0ms in other

2020-10-04 22:16:20.639269 INFO AppDaemon: Terminating IRControl

2020-10-04 22:16:20.647551 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/IRControl.py`

  • What is the effect of this warning? Something in your code is blocking the thread. Please post the code so we can have a look. You most likely should make sure it is written as an async app.

  • Will it affect my other AppDaemon automations? Yes, it might, due to thread starvation.

  • Will it affect home assistant? No

  • Does it restart the app? If the app is restarted, it will say so in the logs and that appear to be the case according to the last line in the logs.

Thanks for your fast feedback, I’ll look into the async options.

I’m calling a few of these services (it might be the Xiaomi remote is sometimes blocking for seconds, still looking into that) :


    self.log("Turning ON amplifiers")

    self.TurnAmpBrandOn() #call services for AmpBrand IR control

    self.call_service("remote/send_command", entity_id = "remote.xiaomi_miio_192_168_1_225", command = "anotheramp_digital")

    self.call_service("remote/send_command", entity_id = "remote.xiaomi_miio_192_168_1_225", command = "anotheramp_5")```