Page 1 of 1

Logger with postgresql... retry/reconnect logic

PostPosted: Sat Sep 28, 2019 12:27 pm
by DPattee
Postgresql doesn't like being hard rebooted after power failures and UPSes don't always cover entire outages, so occasionally things come back up in a bad state.

Recovering postgres from the most common failure mode (.pid not getting deleted upon system restart) is pretty easy to automate. But once the indigo Logger plugin gets stuck, the only way to 'unstick' it is to disable/renable the plugin.

The failure is reflected in the logs as repeated broken pipe messages. If the plugin would detect repeated broken pipes and attempt to automatically recreate the connection it would be more robust.

Code: Select all
 SQL Logger Error                exception trying to insert row into table variable_history_1045860997 ("Unifi_Count_ALL_lastChange")
   SQL Logger Error                [Errno 32] Broken pipe
   SQL Logger Error                INSERT INTO variable_history_1045860997 (value) VALUES (%s);
   SQL Logger Error                exception trying to insert row into table variable_history_1012734241 ("Unifi_Count_ALL_Home")
   SQL Logger Error                [Errno 32] Broken pipe
   SQL Logger Error                INSERT INTO variable_history_1012734241 (value) VALUES (%s);
   SQL Logger Error                exception trying to insert row into table variable_history_97248977 ("Unifi_Count_ALL_Away")
   SQL Logger Error                [Errno 32] Broken pipe
 

Re: Logger with postgresql... retry/reconnect logic

PostPosted: Sat Sep 28, 2019 12:56 pm
by matt (support)
Thanks – we'll look into this.

Re: Logger with postgresql... retry/reconnect logic

PostPosted: Sat Sep 28, 2019 9:03 pm
by kw123
you could add a trigger:
event:that log file error,
actions:
==delete that file
== reload plugin logger
?

or does reload not work? Does it need to be disabled and then reenabled?
indigo does not allow to disable a plugin .. I know I know security concerns .. but if someone can do THAT they could much more on the mac


Karl

Re: Logger with postgresql... retry/reconnect logic

PostPosted: Fri Feb 07, 2020 2:00 pm
by matt (support)
Indigo 7.4.1 is now available and better handles this broken pipe connection error.