LRM (LF 1684): a meta-data operation fix introducing short sleep on zero reads

2 years ago

author
Dejan Muhamedagic <dejan@hello-penguin.com>
date
Mon Aug 20 18:15:59 2007 +0200
changeset 11208
0ded50597e97
parent 11207
93d093a01851
child 11210
7abaafede299

LRM (LF 1684): a meta-data operation fix introducing short sleep on zero reads

A meta-data operation used to sleep for one second in case output
from the OCF RA was not ready. This would make lrmd do nothing
for that period of time and in an unfortunate timing on signal
delivery immediately before, the signal handling would be
delayed. Thus the annoying message:

G_SIG_dispatch: Dispatch function for SIGCHLD was delayed 1000 ms (> 100 ms)

This patch should improve the situation significantly, but the
proper way would be to read the meta-data output in an
asynchronous manner, either in a child process or by using a
proper glib facility.

Thanks to Alan Robertson for spotting the problem.

lib/plugins/lrm/raexecocf.c file | annotate | diff | revisions
     1.1 --- a/lib/plugins/lrm/raexecocf.c	Mon Aug 20 17:40:24 2007 +0200
     1.2 +++ b/lib/plugins/lrm/raexecocf.c	Mon Aug 20 18:15:59 2007 +0200
     1.3 @@ -33,6 +33,7 @@
     1.4  #include <errno.h>
     1.5  #include <glib.h>
     1.6  #include <clplumbing/cl_log.h>
     1.7 +#include <clplumbing/realtime.h>
     1.8  #include <pils/plugin.h>
     1.9  #include <dirent.h>
    1.10  #include <libgen.h>  /* Add it for compiling on OSX */
    1.11 @@ -320,7 +321,7 @@
    1.12  			g_string_append(g_str_tmp, buff);
    1.13  		}
    1.14  		else {
    1.15 -			sleep(1);
    1.16 +			cl_shortsleep();
    1.17  		}
    1.18  	}
    1.19  	if (0 == g_str_tmp->len) {

mercurial