-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rules are sometimes loaded two times on edit #671
Comments
I see the same thing on my RPI2. |
In fact it is not clear at all to me why the refresh is triggered twice. |
Is this possible the samba issue, where the samba server changes file permissions after the write, causing the file to load twice? Would be interesting if you still see the issue when using VS Code with the recently added ssh extension for accessing the files. |
That is true, I am replacing the rule file from a samba share. I will try to copy the file first on the RPI outside the conf folder and then see if the replacement is triggering the two reloads. |
I don't know about that. But the samba issue was discussed a few times in the ESH repo. |
Happens for me with local vi edit so samba is not the trigger. Somewhere in the code I think I saw a 10 second timeout but can't find it atm. |
On my side I just tried with a command touch and I got only one refresh. |
Clearly, for me, the problem is relative to the use of a Samba share but I don't understand why I don't have the same result in cases 3 and 4. |
Note that on my RPI2, the observer takes a long time to detect a change. |
@lolodomo Did you try with a complex rule file? I've noticed the complexity of the file (f.e. rule count, using persistence) does matter on the behavior. In my test, using a rule file with 9 rules in 208 lines of code with local vi-edit results in double-refresh of the file. Maybe your point for the slow observer is part of the problem. |
I have only one rule file with all my rules. 832 lines. |
@lolodomo Is this still the case? There have been lots of improvements since 2019 to both, the script file handling and the watch service in general. |
I would be surprised if this is fixed. I will try again. |
This has been reported again in #3006, so it's still present. |
Hi,
when working with complex rules on the raspberry, rule files get compiled two times resulting in noticable performance issues:
As a workaround, I'm thinking of a delay when a model is reloaded. Proper place IMHO could be here:
openhab-core/bundles/org.openhab.core.model.core/src/main/java/org/eclipse/smarthome/model/core/internal/ModelRepositoryImpl.java
Line 89 in 48d873a
Is this correct?
Is this issue noticeable on faster platforms?
Thanks & best regards,
Sascha
The text was updated successfully, but these errors were encountered: