NUT-Monitor: Add automatic reconnection mechanism for Py2Gtk2 too#3530
NUT-Monitor: Add automatic reconnection mechanism for Py2Gtk2 too#3530jimklimov wants to merge 3 commits into
Conversation
- Add automatic reconnection when connection to NUT server is lost - Implement proper teardown of old PyNUTClient instances - Use specific exceptions (socket.error, ConnectionError, EOFError, OSError, PyNUT.PyNUTError) - Prevent multiple simultaneous reconnection attempts - Add 'was_online' flag to track connection state changes - Tested and confirmed working on both Qt5 and Qt6 Closes: networkupstools#3509 Signed-off-by: Programer <developer.sorli@gmail.com>
…stools#3509, networkupstools#3523] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…tion modeled after PR networkupstools#3523 for Python3 siblings [networkupstools#3509] Co-Authored-By: Programer <developer.sorli@gmail.com> Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 39637b8 is temporarily available: NUT-tarballs-PR-3530.zip. |
|
✅ Build nut 2.8.5.4929-master completed (commit acaf0b2929 by @jimklimov)
|
|
Seems to work. I found a host where Py2Gtk could still run (NetBSD 9.2), connected to a NUT server from NUT-Monitor, and stopped the server. Within a few seconds, the client status bar was cycling the reconnection messages every couple of seconds: and it was satisfied soon after I started the data server back: NOTE: The status bar message remains "Reconnected" even after a couple of hours, as opposed to "Connected..." seen initially. Double-checked that at least Py3Qt5 variant worked similarly at least once, more details in #3523. Kudos to @developersorli for the original work on Python3 versions, and IntelliJ Junie for porting it to Python2 :) |



Replicate the solution from #3523; testing needed
Should help UI on antique platforms that can not for some reason be updated; in fact I currently struggle to find testbeds with GUI that would be so far behind ;)