Wow

great catch.

Feel free to commit when ready.

On Wed, 2008-09-17 at 21:32 +1200, Angus & Anna Salkeld wrote:
> In some cases, the syslog() call may block. If this happened, the AIS worker
> thread would block waiting on the syslog() call. However, the worker thread
> is still holding a logsys mutex, which is needed to enqueue any more log
> messages from the other AIS threads. So the main AIS thread blocks waiting
> on the logsys mutex. This can then cause aisexec on other nodes to detect
> the node as leaving the cluster.
> 
> Author: Tim Beale <[EMAIL PROTECTED]>
> ---
>  exec/logsys.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/exec/logsys.c b/exec/logsys.c
> index bc519f1..425d0e2 100644
> --- a/exec/logsys.c
> +++ b/exec/logsys.c
> @@ -274,6 +274,10 @@ static void log_printf_worker_fn (void
> *thread_data, void *work_item)
>               fflush (stdout);
>       }
> 
> +     /* release mutex here in case syslog blocks */
> +     if (logsys_wthread_active)
> +             pthread_mutex_unlock (&logsys_config_mutex);
> +
>       if ((logsys_mode & LOG_MODE_OUTPUT_SYSLOG_THREADED) &&
>               (!((logsys_mode & LOG_MODE_FILTER_DEBUG_FROM_SYSLOG) &&
>                  (log_data->priority == LOG_LEVEL_DEBUG)))) {
> @@ -281,8 +285,6 @@ static void log_printf_worker_fn (void
> *thread_data, void *work_item)
>                       &log_data->log_string[log_data->syslog_pos]);
>       }
>       free (log_data->log_string);
> -     if (logsys_wthread_active)
> -             pthread_mutex_unlock (&logsys_config_mutex);
>  }
> 
>  static void _log_printf (
> --
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to