snarky-snark / home-assistant-variables

A custom Home Assistant component for declaring and setting generic variable entities dynamically.
Apache License 2.0
278 stars 16 forks source link

Timeout Errors when var service call from AppDaemon #25

Closed jacekpaszkowski closed 4 years ago

jacekpaszkowski commented 4 years ago

Iny ideas why sometimes i get this kind of errors in AD?

2020-03-09 15:57:45.081046 WARNING salon_purifier_controller: Unexpected error in worker for App salon_purifier_controller:
2020-03-09 15:57:45.084617 WARNING salon_purifier_controller: Worker Ags: {'id': '8d0e0ec0d347422bbfc1afaf9b35bca7', 'name': 'salon_purifier_controller', 'objectid': 'ec664cb8795848d4a4a094193f677744', 'type': 'scheduler', 'function': <bound method SalonPurifierController.reset_trigger_variable of <salon_purifier_controller.SalonPurifierController object at 0x7f814f3490>>, 'pin_app': True, 'pin_thread': 7, 'kwargs': {'pin': True, '__thread_id': 'thread-7'}}
2020-03-09 15:57:45.088877 WARNING salon_purifier_controller: ------------------------------------------------------------
2020-03-09 15:57:45.112356 WARNING salon_purifier_controller: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 766, in worker
    funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/salon_purifier_controller.py", line 141, in reset_trigger_variable
    self.call_service('var/set', entity_id = self.trigger_entity, value = 'off')
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 191, in inner_sync_wrapper
    f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 285, in run_coroutine_threadsafe
    result = future.result(self.AD.internal_function_timeout)
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 441, in result
    raise TimeoutError()
concurrent.futures._base.TimeoutError
snarky-snark commented 4 years ago

Sorry, I'm not too familiar with App Daemon, but I can't think of why the var component would be behaving differently than other components in that context.

Have you noted this behavior with other components or are you setting variables at a high rate?

jacekpaszkowski commented 4 years ago

No, only AppDaemon and it happes totally random.