[syslog-ng] internal() messages looping back on PostgreSQL restart

Balazs Scheidler bazsi at balabit.hu
Wed Aug 17 09:31:06 CEST 2011


On Mon, 2011-08-08 at 16:34 -0500, Aaron wrote:
> I have syslog-ng logging to a remote PostgreSQL database and to a local log file as well.  If at any point the Postgres database restarts and syslog-ng happens to attempt to log to the database for the brief period that Postgres is unavailable, my local messages are flooded with internal() looping back messages similar to this:
> 
> syslog-ng[31587]: syslog-ng internal() messages are looping back, preventing loop by suppressing further messages; recurse_count='3'
> syslog-ng[31587]: syslog-ng internal() messages are looping back, preventing loop by suppressing further messages; recurse_count='3'
> syslog-ng[31587]: syslog-ng internal() messages are looping back, preventing loop by suppressing further messages; recurse_count='2'
> 
> My guess is that syslog-ng panics when it is unable to connect to the PostgreSQL database.  The problem is that syslog-ng never re-establishes the connection, and writes several thousands of the above messages to the local log file each second, which can become a little problematic resource-wise.  In order to make syslog-ng behave again, I need to manually restart the service, otherwise it would continue to flood my local messages and never reconnect to the database.  
> 
> I thought it might be a problem with my configuration, and I tried using the time_reopen() option but that seemed to have no effect.  Is this perhaps a bug?
> 

Indeed it's not good. As it seems the message loop logic is not working
properly for SQL destinations. syslog-ng should detect if the processing
of a message triggers an internal message, which again triggers the same
internal message and so on.

As it seems the error message that indicates the loopback would trigger
itself in SQL.

I'll try to look into it.

Thanks for the report.

-- 
Bazsi




More information about the syslog-ng mailing list