v0.9.8 bugfix update
authorTim Pepper <timothy.c.pepper@linux.intel.com>
Tue, 9 Oct 2012 19:15:03 +0000 (12:15 -0700)
committerTim Pepper <timothy.c.pepper@linux.intel.com>
Tue, 9 Oct 2012 19:15:03 +0000 (12:15 -0700)
Debug poll timer of 60 seconds got committed instead of 15 minute timer.

The per-submit-url good/bad send counts were not being zeroed between
urls, leading to odd log messages.

The submit loop drains the work_list to the first good url.  It then
should break rather than continuing to loop testing the connection to
possibly remaining submission urls in the url array, despite there being
no work to send them.

If none of the urls worked, the loop completes with work_list still
holding data, which becomes the requeue_list.

Thanks to William Douglas <william.douglas@intel.com> for the bug report!

Signed-off-by: Tim Pepper <timothy.c.pepper@linux.intel.com>
configure.ac
src/corewatcher.c
src/submit.c

index bfd390a..9c676b2 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ([2.68])
-AC_INIT([nitra-corewatcher],[0.9.7],[timothy.c.pepper@linux.intel.com])
+AC_INIT([nitra-corewatcher],[0.9.8],[timothy.c.pepper@linux.intel.com])
 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
 AC_CONFIG_FILES([Makefile src/Makefile])
 AC_CONFIG_SRCDIR([src/corewatcher.c])
index 313255a..eb373b3 100644 (file)
@@ -207,7 +207,7 @@ int main(int argc, char**argv)
         * If the system seems to generally work well, this time could be
         * extended quite a bit longer probably.
         */
-       g_timeout_add_seconds(60, scan_folders, NULL);
+       g_timeout_add_seconds(900, scan_folders, NULL);
 
        g_main_loop_run(loop);
 out:
index 5f7c7cb..878b7a4 100644 (file)
@@ -233,11 +233,11 @@ void *submit_loop(void __unused *unused)
                curl_easy_setopt(handle, CURLOPT_NOBODY, 1);
                curl_easy_setopt(handle, CURLOPT_TIMEOUT, 5);
 
-               sentcount = 0;
-               failcount = 0;
-
                /* try to find a good url (curl automagically will use config'd proxies */
                for (i = 0; i < url_count; i++) {
+                       sentcount = 0;
+                       failcount = 0;
+
                        curl_easy_setopt(handle, CURLOPT_URL, submit_url[i]);
 
                        /* check the connection before POSTing form */
@@ -246,8 +246,9 @@ void *submit_loop(void __unused *unused)
                                fprintf(stderr, "+ unable to contact %s\n", submit_url[i]);
                                continue;
                        }
+                       fprintf(stderr, "+ Draining work_list to %s\n", submit_url[i]);
 
-                       /* have a good url/proxy now...send reports there */
+                       /* have a good url/proxy now...attempt sending all reports there */
                        while (work_list) {
                                oops = work_list;
                                work_list = oops->next;
@@ -279,9 +280,11 @@ void *submit_loop(void __unused *unused)
                        if (failcount)
                                syslog(LOG_WARNING, "Failed to send %d coredump signatures to %s", failcount, submit_url[i]);
                        closelog();
+
+                       break;
                }
                if (work_list) {
-                       work_list->next = requeue_list;
+                       fprintf(stderr, "+ No urls worked, requeueing all work\n");
                        requeue_list = work_list;
                }