[syslog-ng] [PATCH] afsql: Fix a deadlock when using explicit commits.

Gergely Nagy algernon at balabit.hu
Fri Feb 10 12:59:44 CET 2012


When using explicit commits, in case the COMMIT results in an error,
syslog-ng forgot to release a mutex, resulting in a deadlock the next
time the same error happened.

The fix is to do release the mutex in this error path, too.

Signed-off-by: Fried Zoltan <deirf at balabit.hu>
Signed-off-by: Patrick Hemmer <syslogng at stormcloud9.net>
Signed-off-by: Gergely Nagy <algernon at balabit.hu>
---
 modules/afsql/afsql.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/afsql/afsql.c b/modules/afsql/afsql.c
index b3fec86..d3c72c9 100644
--- a/modules/afsql/afsql.c
+++ b/modules/afsql/afsql.c
@@ -890,6 +890,7 @@ afsql_dd_database_thread(gpointer arg)
                     {
                       afsql_dd_disconnect(self);
                       afsql_dd_suspend(self);
+                      g_mutex_unlock(self->db_thread_mutex);
                       continue;
                     }
                 }
-- 
1.7.9




More information about the syslog-ng mailing list