Logger with postgresql... retry/reconnect logic

Posted on
Sat Sep 28, 2019 12:27 pm
DPattee offline
Posts: 453
Joined: Jan 14, 2004
Location: Redmond, WA

Logger with postgresql... retry/reconnect logic

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
 

Posted on
Sat Sep 28, 2019 12:56 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

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

Thanks – we'll look into this.

Image

Posted on
Sat Sep 28, 2019 9:03 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

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

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

Posted on
Fri Feb 07, 2020 2:00 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

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

Indigo 7.4.1 is now available and better handles this broken pipe connection error.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest