From what I see there is a short time (1, maybe 2 minutes) between the time I see things being updated and the reloading being evident from my log lines. However, I can already see the cpu go up to roughly 100%. I think that in the time in between, the rules have started to reload.
The common thing that I am seeing is that things get updated. I wouldn’t look to deeply into Max! binding. I am certain that I have seen no Max! cube reboots in my logs, other than the ones I caused today.
Yes, I am using the exclusive mode, but there is a “1000 requests until connection is closed and reopened”-configuration, and the request interval is 30 seconds. As 1000 * 30 seconds is 8:20 hours, every 8:20 hours the connection is reopened and somehow this triggers the startup rules.
I think you can change that, too.
Your error seems strange, though, as the binding should not touch any files.
Eventually you have a rule to trigger upon one of the cube channels ?
Either way, you’re invading someone else’s thread, so I moved this to a separate one.
No it only does that in your box (if at all), so there must be something specific about your setup.
Did you use a .things file to create the maxcube thing ? If so, try deleting that and create the thing via UI.
Well, as I posted, if I reboot my max cube from the UI, a rules reload is triggered. My max configuration is all set up from UI. I have not seen the 8 hour, 15 minutes reload, but I will check my logs now that I have had openhab running without restarting over Christmas.
So the max binding is not reconnecting periodically on your device? Do you also use OH 2.5 and the default values? ( exclusive mode = true, maxRequestsPerConnection = 1000 and refreshInterval = 30s?).
I don’t have use *.things files, only *.items and *.rules files.
And when it reconnects, it seems to receive an MMessage again and update the thing configuration, which actually looks like some kind of bug:
if (!roomPropertiesSet) {
setProperties(msg);
}
setProperties(msg);
I think the second setProperties shoudn’t be there, then it wouldn’t update the things on reconnect and therefore no startup rules would be triggered. Or do I misunderstand some part of the code here?
Though it should not trigger any rules,
I made a small change that should avoid unnecessary updates to the config.
I’m doing small test and will submit the PR if successful
note the line @dominicdesu found should probably be fixed as well. => I’ve added it to the PR now
I have checked my logs. From time to time my network has problems and the connection to the cube is lost. The cube then goes offline and a few moments later the connection is reestablished. Basically everything works well, except for the fact that I have a crappy network. However, this cube going offline and coming online again causes the Max things to be updated and the rules reloading.
I am certain that before 2.5 openhab would from time to time lose the connection to the cube. However, the rule reloading problem didn’t exist before 2.5 m5. What was changed?
Getting back to the original problem, we took your word for granted that it’s the MAX! addon to cause rule reloads although that still seems pretty odd. Yes 1000 * 30 secs is 8:15 but it still could be just coincidence.
Can you exclude possible dependency of files or rules on the binding to reconnect or the cube to restart (changing Thing status to OFFLINE), are you sure there’s no binding restart or cube boot ?
Have you cleared the cache, did you reinstall ?
2019-12-24 17:09:22.479 [me.event.ThingUpdatedEvent] - Thing 'max:bridge:KEQ0xx' has been updated.
2019-12-24 17:09:22.663 [me.event.ThingUpdatedEvent] - Thing 'max:shuttercontact:KEQ0xx:JEQ0xxxx' has been updated.
2019-12-24 17:09:22.697 [me.event.ThingUpdatedEvent] - Thing 'max:shuttercontact:KEQ0xx:JRE0xxxx' has been updated.
I cleared the cache after updating to OH 2.5, but I did not reinstall anything.
Okay, after removing the mentioned line setProperties(msg);, the configuration update of the bridge doesn’t occur anymore (at least it doesn’t appear in the logs). However, configuration update of the other things still happens and this maybe still leads to the rules refresh?
I agree with you that both are strange. Even if I change the Max! bridge thing configuration through PaperUI, the rules are refreshed. For other bindings (hue, zwave) this doesn’t seem to be the case…
The only thing I can think of is that due to the multiple updates happening in very short time zone race condition occurs.
There is nothing I’m aware of in the max binding that is related to rules.
Note that scanning the forum most folks experiencing issues with oh2.5 have bindings that make config changes (max, zwave, miio… + few more) I can imagine the is a correlation.
It looks like @marcel_verpaalen is already working on your problem No. 1.
The 2nd problem sounds really odd. Currently I have to admit that I do not have a clue what could be the cause of it. But I never heard about a relation between updating a configuration of a thing and refreshing / reloading rule files before. @dominicdesu Just to be clear: You are talking about reloading rule files? Do you? I am asking because in your linked issue you are talking about triggering startup rules which from my point of view is something different.
I am aware of a feasible issue related to configuration updates: It is possible to create an interminable loop - e.g if the ThingHandler calls updateConfiguration() from its initialize() method, because a configuration update leads to a new initialization of the thing.