Announcement

Collapse
No announcement yet.

Dropping event callbacks due to full queue - Hubitat Plug-in Issue?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Dropping event callbacks due to full queue - Hubitat Plug-in Issue?

    Sorry for the cross-post but I thought I'd post this here as well:
    Thanks,
    Scott

    #2
    Scripts and plugins can register to be called when an event type occurs. An event being device set, device change, log written, etc. My inference of the HS event callback design is that HS maintains a queue of events that have triggered and the script/plugin that needs to be called for each. It calls the script/plugin and when the return occurs the queue entry is removed.

    HS limits the queue size. When something cannot be added because the queue is full then it will log a message about not being able to add the entry. The problem is not information in the log, but something that occurred some time in the past where the script/pluign was called and never returned. HS may put a time limit on the call and should report that the time limit has been exceeded, but I do not know if it does this or not.

    As previously mentioned the way to diagnose is to remove scripts/plugins that are asking for event callbacks. It will take awhile to diagnose because many events have to occur before the queue becomes full.

    To address the HS event queue issue my plugins I do not act upon the callback made by HS directly. I maintain a separate event queue in the plugin and work off the events in the queue in a thread separate from the HS thread. This means that the time spent responding to the HS event callback is only the time to copy the callback information into the plugin's queue. This then allows HS to remove it from its event queue almost immediately. I understand AlexBK does a similar approach in his plugins.

    Comment


      #3
      Thanks for the fast response Michael! I believe I understand what you’re explaining. Do you know if there’s a way to have a Snapchat taken of this problematic queue when the first error message gets triggered? It would be so helpful to know what is filling/humming up the queue. I have tried tinkering with setting various debug modes in the control panel, but haven’t really found anything that points to an issue.

      Comment

      Working...
      X