Strange problem after upgrading to Debian 11 (Bullseye) and Python 3.9
Posted: Monday 16 August 2021 13:51
My plugin (https://github.com/d-EScape/Domoticz_iDetect) was working fine in Debian 10 (Buster) and Python 3.7, but throws lots of (different, but mostly different types of timeouts) ssh exceptions after upgrading to Debian 11, which includes Python 3.9. After a while the exceptions would slow down Domoticz, making it almost completely unresponsive and sometimes crash. The ssh communication in the plugin is using paramiko.
The initialization seemed to run fine, including some ssh executions(!) But most of the time the exceptions started occurring shortly after. Experimenting with longer timeouts and intervals did not make any difference. But I noticed that the exceptions only occurred after (re)starting Domoticz. Not when the plugin was restarted from within Domoticz. So for now I build a startup delay into the plugin. The real onStart (which is now renamed) will run after some heartbeats.That seems to avoid the exceptions (it has now been running for about an hour, but would throw exceptions within minutes without the delay).
Has anyone seen this kind of behavior before? What could possibly make the plugin fail this way with the same Domoticz version, but a different Debian and/or Python version? What could cause a plugin to fail on a Domoticz (re)start, but not when only restarting the plugin? It could be that Domoticz just is not completely ready, but that would not explain why the exceptions do not occur immediately (with the fist ssh connections). Does the Python 3.7 to 3.9 transition introduce different startup behavior for the plugin framework?
Any help in finding the true cause of this issue and -preferably- a solution would be most welcome!
@Dnpwwo: hope you also read this and have some insights
The initialization seemed to run fine, including some ssh executions(!) But most of the time the exceptions started occurring shortly after. Experimenting with longer timeouts and intervals did not make any difference. But I noticed that the exceptions only occurred after (re)starting Domoticz. Not when the plugin was restarted from within Domoticz. So for now I build a startup delay into the plugin. The real onStart (which is now renamed) will run after some heartbeats.That seems to avoid the exceptions (it has now been running for about an hour, but would throw exceptions within minutes without the delay).
Has anyone seen this kind of behavior before? What could possibly make the plugin fail this way with the same Domoticz version, but a different Debian and/or Python version? What could cause a plugin to fail on a Domoticz (re)start, but not when only restarting the plugin? It could be that Domoticz just is not completely ready, but that would not explain why the exceptions do not occur immediately (with the fist ssh connections). Does the Python 3.7 to 3.9 transition introduce different startup behavior for the plugin framework?
Any help in finding the true cause of this issue and -preferably- a solution would be most welcome!
@Dnpwwo: hope you also read this and have some insights