summaryrefslogtreecommitdiffstats
path: root/server/parser
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-12-08 14:50:06 +0100
committerDavid Sommerseth <davids@redhat.com>2009-12-08 14:50:06 +0100
commit987dc4def6248de249acd942ece4bf96140ae9be (patch)
treee5566bbc11f8d85a43b7578937efb340c33c3910 /server/parser
parentc61b345f96678d4bcc9a2588649509ae51a695c4 (diff)
downloadrteval-987dc4def6248de249acd942ece4bf96140ae9be.tar.gz
rteval-987dc4def6248de249acd942ece4bf96140ae9be.tar.xz
rteval-987dc4def6248de249acd942ece4bf96140ae9be.zip
Avoid unexpected exit if the main thread starts process_submission_queue() too early
If the process_submission_queue() function in the main thread is started before the parsethread() based threads, the number of active threads will be 0 and process_submission_queue() will immediately send a "shutdown" message and exit. The quick solution is to sleep 3 seconds before starting the process_submission_queue() job. This way at least a few of the parsethread() threads should have had time to start up and setle.
Diffstat (limited to 'server/parser')
-rw-r--r--server/parser/rteval_parserd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/parser/rteval_parserd.c b/server/parser/rteval_parserd.c
index 2339a0f..c9129ff 100644
--- a/server/parser/rteval_parserd.c
+++ b/server/parser/rteval_parserd.c
@@ -463,6 +463,7 @@ int main(int argc, char **argv) {
// checks the submission queue and puts unprocessed records on the POSIX MQ
// to be parsed by one of the threads
//
+ sleep(3); // Allow at least a few parser threads to settle down first before really starting
writelog(logctx, LOG_DEBUG, "Starting submission queue checker");
rc = process_submission_queue(dbc, msgq, &activethreads);
writelog(logctx, LOG_DEBUG, "Submission queue checker shut down");