Simutaneous writing of global variables in dzvents can create data loss and errors

Moderator: leecollings

Post Reply
Kifo
Posts: 11
Joined: Wednesday 22 March 2017 12:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Simutaneous writing of global variables in dzvents can create data loss and errors

Post by Kifo »

I have several dzvents sripts writing global variables at domoticz.globalData. Recently I discovered, if two such scripts are triggered at the same time, this can result in
  • values getting lost (deleted from the list of global variables)
  • unspecfic error messages such as
    - dzVents: There was a problem writing the storage values
    - Lua script execution exceeds maximum number of lines
    - auth token mismatch
Especially writing complex data like history tables or larger objects at the same time can cause the issue. It does not happen all the time, but about 1 or 2 times a day.
After arranging the execution time of these scripts in a way that they are never executed at the same time, these effects disappeared.

Looks like dzvents is lacking an effectiv execution queue for writing the global data.
Post Reply