turris-maintain: network-restart reload of network occurs too fast, which breaks notifications about pending network restart
network-restart.py
script tries at first to send notification that network restart is pending ("restart in 2s", "1.8s", "1.6s", ...).
Then it proceeds to actually reload* network (/etc/init.d/network reload
).
But what actually happens, is that network reload is executed while notifications are still being sent through mqtt.
Therefore the reForis connection to the backend on the router disconnects, which breaks the WebSocket connection and all further notifications are effectively lost. Even thought they are being sent via the mqtt.
reForis expects to receive notification that basically says "now it is time to try to reconnect" ({"remains": 0}
aka 0 seconds), but it never arrives, causing the spinner in reforis to keep spinning forever.
So we could
- either refactor the reconnect handling logic in reForis to be able to handle disconnects gracefully
- or somehow postpone the network reload a little bit, triggered in
network-restart.py
script, to make sure that notifications were sent and we can safely execute the network reload
On notice: @agumroian
- It is desirable to do reload instead restart, because it should reload only these interfaces that are related to change in config.