From 987dc4def6248de249acd942ece4bf96140ae9be Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Tue, 8 Dec 2009 14:50:06 +0100 Subject: 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. --- server/parser/rteval_parserd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'server/parser') 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"); -- cgit